Skip to content

Harden scraper against SSRF - #3

Merged
technoporada merged 2 commits into
mainfrom
agentic-autofix/fix-code-scanning-alerts-again
Oct 28, 2026
Merged

technoporada merged 2 commits into
mainfrom
agentic-autofix/fix-code-scanning-alerts-again

Conversation

@github-agentic-autofix

@github-agentic-autofix github-agentic-autofix AI commented Oct 28, 2026 •

Copy link
Copy Markdown

The scraper accepted user-controlled URLs, creating an SSRF risk. Validate the initial URL and every redirect before making a request.

  • URL validation: Permit only HTTP(S) URLs whose hosts resolve exclusively to public IP addresses.
  • Redirects: Revalidate each destination and block redirects to non-public hosts.
  • Scraper flow: Restore response parsing after the redirect loop so successful fetches return their results.
https://example.com/     → eligible for fetch
http://127.0.0.1/         → blocked
file:///etc/passwd        → blocked

Co-authored-by: technoporada <171401859+technoporada@users.noreply.github.com>
@technoporada
technoporada marked this pull request as ready for review October 28, 2026 05:48
@github-agentic-autofix github-agentic-autofix AI changed the title [WIP] Fix code scanning alert #5 Harden scraper against SSRF Oct 28, 2026
GitHub Agentic Autofix finished work on behalf of technoporada October 28, 2026 05:49
@technoporada
technoporada merged commit dc0b2ed into main Oct 28, 2026
10 checks passed
@technoporada
technoporada deleted the agentic-autofix/fix-code-scanning-alerts-again branch October 28, 2026 05:49
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.

2 participants