π‘οΈ Sentinel: [HIGH] Fix quoted secret redaction bypass - #414
Conversation
|
π 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. |
# Conflicts: # .jules/sentinel.md
π¨ Severity: HIGH
π‘ Vulnerability:
The redaction regular expression (
KV_PATTERN) used insrc/core/security/redaction.tsfor sanitizing key=value pairs failed to match and redact secret values when they were surrounded by quotes (e.g.,password="mysecret"). The character class[^\s,'"]+explicitly excludes single and double quotes, meaning it would stop matching as soon as it hit a quote, effectively bypassing redaction and potentially leaking sensitive credentials in audit logs.π― Impact:
If a user provided a quoted secret in configuration, shell inputs, or environment variables, that raw quoted secret could have been logged in plain text to the audit trails or terminal outputs.
π§ Fix:
Updated
KV_PATTERNto correctly account for string literals by including"[^"]*"and'[^']*'in the capture group for the value:β Verification:
bun test tests/unit/context-audit-redaction.test.tsandbun test tests/unit/core/tools/headless-payload.test.ts.'password="mysecret"'is successfully replaced with'password=[REDACTED]'.bun run test:full) to ensure no regressions..jules/sentinel.md.PR created automatically by Jules for task 7809680076242199412 started by @YoungSx