Skip to content

Security: Unrestricted outbound URL fetch enables SSRF in parse() URL mode#559

Open
tuanaiseo wants to merge 1 commit intokurtmckee:mainfrom
tuanaiseo:contribai/fix/security/unrestricted-outbound-url-fetch-enables-
Open

Security: Unrestricted outbound URL fetch enables SSRF in parse() URL mode#559
tuanaiseo wants to merge 1 commit intokurtmckee:mainfrom
tuanaiseo:contribai/fix/security/unrestricted-outbound-url-fetch-enables-

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

feedparser.http.get() performs requests.get(url, ...) on caller-provided URLs without host/IP allowlisting, private-network blocking, or scheme hardening at this layer. In services that pass user-controlled feed URLs to feedparser.parse(), this can be used to access internal metadata/services (SSRF), especially with default redirect following.

Severity: high
File: feedparser/http.py

Solution

Add a secure URL validation gate before fetching: restrict to http/https, resolve DNS and block loopback/link-local/RFC1918 ranges, optionally enforce an allowlist, and disable or tightly control redirects (allow_redirects=False or re-validate each redirect target).

Changes

  • feedparser/http.py (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

`feedparser.http.get()` performs `requests.get(url, ...)` on caller-provided URLs without host/IP allowlisting, private-network blocking, or scheme hardening at this layer. In services that pass user-controlled feed URLs to `feedparser.parse()`, this can be used to access internal metadata/services (SSRF), especially with default redirect following.

Affected files: http.py

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant