Skip to content

Pin scraper requests to validated public IPs - #1

Merged
technoporada merged 1 commit into
mainfrom
agentic-autofix/fix-code-scanning-alerts
Oct 28, 2026
Merged

technoporada merged 1 commit into
mainfrom
agentic-autofix/fix-code-scanning-alerts

Conversation

@github-agentic-autofix

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

Copy link
Copy Markdown

User-controlled scraper URLs could target internal services, including through DNS rebinding or redirects. Validate each destination and bind its connection to a public IP address.

  • Validate and pin: Allow only HTTP(S), reject credentials and non-public DNS results, and connect to a validated IP while retaining the original hostname for Host and TLS SNI.
  • Revalidate redirects: Validate and pin each redirect destination; disable environment proxies that could bypass the pin.
  • Restore parsing: Run response parsing after the redirect loop so successful fetches return scraper results.

For https://example.com/path, the request connects to the validated IP while keeping Host: example.com and SNI example.com.

@technoporada
technoporada marked this pull request as ready for review October 28, 2026 05:40
@technoporada
technoporada merged commit 0638715 into main Oct 28, 2026
11 checks passed
@technoporada
technoporada deleted the agentic-autofix/fix-code-scanning-alerts branch October 28, 2026 05:41
@github-agentic-autofix github-agentic-autofix AI changed the title [WIP] Fix code scanning alert #8 in repository Pin scraper requests to validated public IPs Oct 28, 2026
GitHub Agentic Autofix finished work on behalf of technoporada October 28, 2026 05:46
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