Gemini CLI glob tool could list /etc/passwd via absolute patterns, PR adds containment
ManoharPaturi · ghdev · 2026-09-27
Another gemini-cli security PR fixes a path-escape bug in GlobTool: execute validates dirpath via resolveToRealPath + validatePathAccess, but passed the raw pattern to the glob library. On glob 12, absolute patterns resolve against the filesystem root and ignore cwd, so /etc/.conf — or {/etc/passwd,fileA.txt} smuggled through brace expansion — lists files outside the workspace, bypassing access validation; Windows drive roots behave the same. The author reproduced it on main, and notes the ../ escape reported in #29075 does not reproduce on glob 12.
The fix is defense in depth:
- isAbsolutePattern rejects POSIX-absolute and Windows drive-root patterns up front with INVALIDTOOLPARAMS.
- Glob results are re-filtered to paths still resolving inside each search directory, dropping any escapes (braces, backslashes, or future glob behavior changes) with a debug warning.
Glob suite passes 41/41 with the fix.
More from coding & agent
- Baseten's Guide: Evaluate Open Models for Coding Agents on Your Own PRs — baseten · 2026-11-16
- Google Research open-sources PaperOrchestra, a multi-agent framework for writing AI papers — google-research · 2026-11-16
- ffmpeg-skill gives coding agents local video editing via 42 FFmpeg tools and MCP — kajisho5 · 2026-11-16
- Agents Now Reply to Slack Messages on Their Own, Resolving a Prod Incident Ghost-to-Ghost — iamrobotbear · 2026-11-16
- Engineer's Interview Prep Method: Use Claude to Find Which Answers Undersell Your AI Work — brandon_galang · 2026-11-16
- DeepSeek open-sources its app frontend "chat-demo", already at 3.9k stars — NielsRogge · 2026-11-16