Fix critical security findings from codebase review#42
Merged
AnExiledDev merged 3 commits intostagingfrom Mar 2, 2026
Merged
Conversation
- Remove env var injection in agent redirect log path (S2-01) - Protected files guards fail closed on unexpected errors (S2-04) - Harden dangerous command regexes: prefix stripping, symbolic chmod, setuid, docker system/volume, git filter-branch, plus-refspec (S2-03) - Unify write-target patterns across guards (5 → 18 patterns) (C1-02) - Fix greedy alternation in redirect regex (>>|> order) (Q3-01) - Block bare git stash in read-only mode (Q3-04) - Narrow configApply allowed destinations to /usr/local/share (S2-09) - Add pytest to CI pipeline (Q3-08) - Add 36 new test cases covering all fixes (241 → 277 tests)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- Version 1.14.2 → 2.0.0 - prepublishOnly now runs npm run test:all (Node + Python tests) - Sync README version to match package.json
The test hardcoded /home/vscode but CI runs as /home/runner. Use the module's _home variable to match the actual environment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses 8 findings from full codebase security/quality review (1 critical, 5 high, 2 medium/low):
/tmp/agent-redirect.logsys.exit(2)instead ofsys.exit(0))\rm,command rm,env rm), symbolic chmod (a=rwx,0777,u+s), docker system/volume, git filter-branch, plus-refspec force push>|>>→>>|>)test-pluginsjob) + staging branch triggersgit stash(equivalent to push) now blocked in read-only modeconfigApplyallowed destinations from/usr/localto/usr/local/shareChanges
redirect-builtin-agents.pyimport osguard-protected.pyguard-protected-bash.pyguard-workspace-scope.pyblock-dangerous.pyguard-readonly-bash.pygit stashblockingsetup.js/usr/local→/usr/local/shareci.ymltest-pluginsjob + staging triggersCHANGELOG.mdTest plan
npm test— 18/18 Node.js tests passpytest tests/ -v— 277/277 Python tests passtest-pluginsjob runs on PR