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
- Salesforce research: buyer agents concede too easily, images boost persuasion ~17% — msrivastav13 · 2026-12-05
- Grok Build launches agent-driven post-quantum cryptography migration after NSA advisory, with $1,000 credits — ns123abc · 2026-12-05
- Seroter's reading list: post-quantum prep, agent harnesses, and life after 99% AI code — rseroter · 2026-12-05
- WSDM Cup 2027 Offers $10k to Build Autonomous Community Notes Agents — sanmikoyejo · 2026-12-05
- Trying Copilot Studio MCP for agent cloning and Power Automate sync: janky but workable — koltregaskes · 2026-12-05
- xAI launches Grok Bot: autonomous AI teammates that live in Slack and Teams — Baconbrix · 2026-12-05