Repository navigation
Conversation
When a blocklist rule contained a space (like `"rm "`) to prevent false positives on legitimate commands (like `"format"`), it failed to match if the blocked token was at the very end of the command string (e.g. `npm run rm`). This patch tokenizes the command first and enforces exact matches for critical sensitive commands (like `rm`), while retaining the existing substring check on the joined command to support multi-word blocks. Co-authored-by: bobdivx <6737167+bobdivx@users.noreply.github.com>
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Closing: false alarm / overlaps #283 and previously closed #291. |
π¨ Severity: HIGH
π‘ Vulnerability: Command blocklist bypass via trailing spaces. The system relies on string checking (e.g.,
contains("rm ")) which fails if the sensitive token is the last word in the command string without trailing spaces.π― Impact: Malicious users could execute explicitly forbidden commands by padding or placing them strategically at the end of the argument string.
π§ Fix: Keep the joined string substring check to preserve existing functionality (e.g., matching multi-word phrases), but additionally loop through individual shell-split tokens and enforce an exact match specifically for
rmto prevent trailing space bypasses.β Verification: Ran
cargo testontools::workdir_cmdand added explicit internal tests validating thatrmis successfully blocked regardless of its position in the string.PR created automatically by Jules for task 1219179541715606041 started by @bobdivx