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:

Glob suite passes 41/41 with the fix.

Original post →

More from coding & agent

coding & agent channel →