Gemini CLI patch closes an SSRF bug by adding async DNS checks before fetch
deepresearcher08 · ghdev · 2026-07-29
Gemini CLI fixes an SSRF hole in web-fetch.ts by switching to async DNS validation
A pull request in google-gemini/gemini-cli fixes an SSRF vulnerability in web-fetch.ts.
- The bug came from isBlockedHost() calling a synchronous isPrivateIp() check.
- That check only handled literal IPs, so a hostname that resolved to something like 169.254.169.254 could bypass validation.
- The fix makes isBlockedHost() async and uses isPrivateIpAsync() so DNS resolution happens before the safety check.
- Related call sites were updated to await the check in both the primary and fallback fetch paths.
- The reporter also notes a remaining TOCTOU / DNS rebinding risk and suggests follow-up hardening:
- pin the connection to the validated IP
- validate all resolved addresses
- broaden private-range coverage
- disable automatic redirects or re-check every hop
More from coding & agent
- 10 open-source repos that let your AI agent reverse-engineer apps and games — victor_explore · 2026-10-16
- The new CTO job: agent management and QA loops, 'cable management' instead of coding — HankYeomans · 2026-10-16
- Why company AI agents go stale: adoption needs in-house knowledge, not just better agents — EdenEmarco177 · 2026-10-16
- Open-source MCP lets coding agents search Obsidian's 9,000-plugin directory before reinventing wheels — pitfa19 · 2026-10-16
- Cheng Lou open-sources Handwired: hand-written weights turn code into training-free neural nets — dotey · 2026-10-16
- Building a portable context vault in Notion so every AI agent knows you from day one — ivanhzhao · 2026-10-16