@Menu(type = "resouce", subtype = "image", access = true)
public void url(HttpServletResponse response, @Valid String url) throws IOException {
if (StringUtils.isBlank(url)) {
// Weak validation: allows any HTTP/HTTPS URL with a path
if(!Pattern.matches("^https?://.*/.*$", url)) {
// Vulnerable sink: fetches URL and returns content
try (InputStream input = new URL(url).openStream()) {
while ((length = input.read(data)) > 0) {
out.write(data, 0, length);