Repository navigation
fix(view): block SSRF in remote images - #1693
kawacukennedy wants to merge 1 commit into
Conversation
f5da9c8 to
907e0a1
Compare
floatpanebot
left a comment
There was a problem hiding this comment.
Hi @kawacukennedy! Please fix the following issues with your PR:
- Title: Is too long (55 characters). The PR title must be strictly under 40 characters.
- Body: Missing the
## What?or## Why?headings required by the PR template.
Benchmark report — no significant changeMetrics worse: 0 · better: 0 (threshold: ±3%). benchstat outputauto-generated by benchmarks.yml |
Formatting issues have been resolved. Thank you!
|
This has had no activity for 45 days. It will be closed in 21 days unless updated. Comment or remove the |
|
Hi @andrinoff — this PR is still open and all CI checks are green; just keeping it off the stale queue. Happy to rebase/adjust if anything needs updating. Thanks! |
|
This has had no activity for 45 days. It will be closed in 21 days unless updated. Comment or remove the |
dae6366 to
fb7afa4
Compare
|
Rebased onto the new v1.0.0
|
…lient A malicious HTML email could embed images pointing at internal services (e.g. http://169.254.169.254/latest/meta-data/ on cloud providers, or http://127.0.0.1:* to reach local applications). Every recipient who views such an email triggers a request to the attacker-controlled URL, enabling server-side request forgery. Add isPrivateHost() DNS resolution check that rejects connections to loopback (127.0.0.0/8), RFC 1918 (10/172.16-31/192.168), link-local (169.254.0.0/16), and IPv6 loopback/link-local addresses. Also limit redirect chains to 5 hops using httpclient.NewWithRedirectCap to prevent SSRF via open-redirect chains, and reuse a single HTTP client across calls instead of creating a new one per image fetch.
fb7afa4 to
ed136fb
Compare
|
CI note: the only failing check here is I've opened #1749 to bump the toolchain (also reachable via |
What?
Block remote image fetches to private/internal IP addresses and cap redirect chains to 5 hops. Reuse a single HTTP client per image fetch instead of creating one per call.
Why?
A malicious HTML email could embed images pointing at internal services (e.g. cloud metadata at
169.254.169.254, or127.0.0.1). Viewing such an email triggered an outbound request to the attacker-controlled URL, enabling SSRF.The default HTTP client also followed up to 10 redirects, allowing SSRF via redirect chains.