Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix command parser bypass allowing exact 'rm' usage - #319

Closed
bobdivx wants to merge 1 commit into
mainfrom
sentinel-fix-rm-bypass-11696394821956051518
Closed

bobdivx wants to merge 1 commit into
mainfrom
sentinel-fix-rm-bypass-11696394821956051518

Conversation

@bobdivx

@bobdivx bobdivx commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Fixes a command parsing bypass vulnerability in the workdir command agent tool.

The previous security logic looked for "rm " and "rm\t" to avoid matching prefixes like chmod. However, this was susceptible to bypass if rm was provided exactly as the last word of the command without any trailing whitespace (e.g. npm run rm).

This commit fixes this by splitting the command into individual tokenized words and ensuring no exact word equals "rm" exactly. We have also added testing to confirm it handles npm run rm correctly, and recorded our learnings in .jules/sentinel.md as instructed.


PR created automatically by Jules for task 11696394821956051518 started by @bobdivx

… usage

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: The `validate_command` check searched for the blocked token `"rm "` (with trailing space). It failed to match exact invocations of `rm` at the end of the line, such as `npm run rm`.
🎯 Impact: Arbitrary deletion of repository files using obfuscated or trailing calls to rm in package management scripts.
πŸ”§ Fix: Added exact token matching iteration over the split words, verifying if any single token equals `"rm"`.
βœ… Verification: Added tests explicitly asserting that `npm run rm` fails validation, run `cargo test -p devforge-agent`.

Co-authored-by: bobdivx <6737167+bobdivx@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@bobdivx

bobdivx commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

Closing: false alarm, same as #291/#308/#310. rm is not in ALLOWED_BINS, so it can never run as the binary, and npm run rm only runs a package script named rm. Blocking the bare word would just add false positives. The validation cleanup is tracked in #283.

@bobdivx bobdivx closed this Nov 11, 2026
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing: false alarm, same as #291/#308/#310. rm is not in ALLOWED_BINS, so it can never run as the binary, and npm run rm only runs a package script named rm. Blocking the bare word would just add false positives. The validation cleanup is tracked in #283.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant