Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ public Subscription fetchSubscription(String feedURL, Date lastModified) throws
throw new IllegalArgumentException("feed url cannot be null");
}

// Validate the feed URL to prevent SSRF attacks. Replace 'http://trusted.com' with your allowed URL prefix or perform a proper whitelist check
final String ALLOWED_PREFIX = "http://trusted.com"; // FIXME: update placeholder with actual authorized URL prefix
if (!feedURL.startsWith(ALLOWED_PREFIX)) {
throw new FetcherException("Unauthorized feed URL: " + feedURL);
}

// fetch the feed
log.debug("Fetching feed: "+feedURL);
SyndFeed feed;
Expand Down
Loading