Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix quoted secret redaction bypass - #414

Merged
YoungSx merged 2 commits into
mainfrom
sentinel-quoted-secret-redaction-7809680076242199412
Aug 31, 2026
Merged

πŸ›‘οΈ Sentinel: [HIGH] Fix quoted secret redaction bypass#414
YoungSx merged 2 commits into
mainfrom
sentinel-quoted-secret-redaction-7809680076242199412

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

🚨 Severity: HIGH

πŸ’‘ Vulnerability:

The redaction regular expression (KV_PATTERN) used in src/core/security/redaction.ts for 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_PATTERN to correctly account for string literals by including "[^"]*" and '[^']*' in the capture group for the value:

const KV_PATTERN = /(\b(?:token|secret|password|api[_-]?key)\b\s*[:=]\s*)("[^"]*"|'[^']*'|[^\s,'"]+)/gi;

βœ… Verification:

  • Ran targeted unit tests bun test tests/unit/context-audit-redaction.test.ts and bun test tests/unit/core/tools/headless-payload.test.ts.
  • Manually tested in a bash shell to verify that 'password="mysecret"' is successfully replaced with 'password=[REDACTED]'.
  • Ran the full test suite (bun run test:full) to ensure no regressions.
  • Logged the critical learning to .jules/sentinel.md.

PR created automatically by Jules for task 7809680076242199412 started by @YoungSx

@google-labs-jules

Copy link
Copy Markdown
Contributor Author

πŸ‘‹ 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.

@YoungSx
YoungSx merged commit 605f04e into main Aug 31, 2026
6 checks passed
@YoungSx
YoungSx deleted the sentinel-quoted-secret-redaction-7809680076242199412 branch August 31, 2026 15:52
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.

2 participants