Skip to content

fix: mitigate SSRF vulnerability (CWE-918) - #8

Open
mihajlo-jovanovic wants to merge 1 commit into
Hyaxia:mainfrom
mihajlo-jovanovic:fix/ssrf-cwe-918
Open

fix: mitigate SSRF vulnerability (CWE-918)#8
mihajlo-jovanovic wants to merge 1 commit into
Hyaxia:mainfrom
mihajlo-jovanovic:fix/ssrf-cwe-918

Conversation

@mihajlo-jovanovic

Copy link
Copy Markdown

Introduce internal/safeclient package that DNS-resolves hostnames before connecting and rejects IPs in private/reserved CIDR ranges (loopback, RFC 1918, link-local, cloud metadata endpoints).

Replace all direct http.Client.Get calls in scraper.go and rss.go with safeclient.SafeGet. Add 8 new unit tests for the safeclient package. Update existing test files with TestMain hooks for httptest.NewServer compatibility.

Introduce internal/safeclient package that DNS-resolves hostnames
before connecting and rejects IPs in private/reserved CIDR ranges
(loopback, RFC 1918, link-local, cloud metadata endpoints).

Replace all direct http.Client.Get calls in scraper.go and rss.go
with safeclient.SafeGet. Add 8 new unit tests for the safeclient
package. Update existing test files with TestMain hooks for
httptest.NewServer compatibility.
@Hyaxia

Hyaxia commented May 5, 2026

Copy link
Copy Markdown
Owner

thanks for the work @mihajlo-jovanovic.
one important thing, i'd love to see some benchmarks around performance here since we're altering the client itself

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