fix(patch): cherry-pick 9ca7300 to release/v0.27.1-pr-18395 to patch version v0.27.1 and create version 0.27.2#18399
Conversation
Summary of ChangesHello @gemini-cli-robot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request is an automated patch release that addresses a critical issue where path validation was being prematurely bypassed under specific conditions. By removing an incorrect early exit, the change ensures that all paths are consistently and thoroughly validated, thereby enhancing the overall robustness and security of path handling within the application. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request cherry-picks a critical security fix. It addresses a critical path traversal vulnerability where the isPathAllowed method in the Config class incorrectly allowed access to any absolute path when running in interactive mode, effectively bypassing workspace constraints. This flaw could have been exploited by a malicious actor to access or modify sensitive system files outside the designated workspace. The change removes this condition, ensuring all file paths are now correctly validated against the workspace, mitigating the vulnerability.
I am having trouble creating individual review comments. Click here to see my feedback.
packages/core/src/config/config.ts (1714-1716)
The code previously allowed any absolute path to be considered 'allowed' if the session was interactive. This created a significant security bypass, as an attacker (e.g., via prompt injection) could force the tool to access or modify sensitive files outside the intended workspace by providing an absolute path. Removing this check ensures that all paths, including absolute ones, are subject to proper workspace boundary validation.
References
- Sanitize user-provided file paths used in file system operations to prevent path traversal vulnerabilities.
- Utility functions that perform file system operations should validate their path inputs internally to prevent path traversal vulnerabilities, rather than relying solely on callers to perform validation.
|
Size Change: -103 B (0%) Total Size: 23.5 MB ℹ️ View Unchanged
|
This PR automatically cherry-picks commit 9ca7300 to patch version v0.27.1 in the stable release to create version 0.27.2.