Gemini CLI extension loader PR blocks path traversal with strict boundary validation
diegogodinezr · ghdev · 2026-09-03
Another hardening PR (#29169) on google-gemini/gemini-cli focuses on path resolution and directory boundary validation in the extension loader.
- New validateContextFilePath() / resolveContextFilePaths() helpers normalize paths via path.resolve, reject absolute paths upfront (POSIX and Windows), filter .. and URL-encoded variants (%2e%2e), and verify targets stay within the extension root via isSubpath().
- Non-standard percent usage (e.g. 100%complete.md) that breaks decodeURIComponent is logged and loaded with the original filename rather than dropped.
- Fault-tolerant loading: invalid context files in gemini-extension. log a warning and are skipped instead of failing the whole extension; plan.directory gets the same boundary checks.
- gemini extensions validate reuses the shared validator for consistent behavior.
A solid template for defending extension/plugin systems against path traversal.
More from coding & agent
- LLM one-shots a Minecraft 3x3 piston door by building its own Linux test infra — Vjeux · 2026-10-18
- Dev builds Mumbai-inspired 3D manga background generator from OpenStreetMap data — CurieuxExplorer · 2026-10-18
- Solo founder builds a money-printing data service on Claude's Pi Durable harness — MicahBerkley · 2026-10-18
- Dev builds Arch-based OS with custom desktop and browser using Claude Code — Snoo-10493 · 2026-10-18
- Five SaaS agent workflows fail the same way — and it's never model intelligence — usehive · 2026-10-18
- Claude skill generates hand-drawn interactive diagrams that teach kids how things work — CatAstro_Piyush · 2026-10-18