Summary
Both the Python sandbox hook (secret_redact_posttool.py) and Go-side SecretRedactor (redactor.go) share four pattern bypasses that allow secrets to pass through unredacted. The patterns appear identical between both implementations.
Affected files
internal/security/hooks/secret_redact_posttool.py:54-88
internal/security/redactor.go:160-177
Bypass vectors
1. Lowercase environment variable names
Pattern: [A-Z_]*(?:SECRET|TOKEN|...) (line 59 / line 165) — uppercase only
Bypass: export my_token=s3cr3t_value_here — lowercase my_token doesn't match [A-Z_]*
Fix: Add (?i) flag or use [A-Za-z_]* for env var name prefix
2. Single-quoted JSON values
Pattern: "...(secret)..." (line 68 / line 166) — double quotes only
Bypass: {'api_key': 'sk-proj-actual-secret-value'} — single quotes not matched
Fix: Add single-quote variant '...' alongside double-quote pattern
3. Multiple @ in database connection strings
Pattern: ([^@\s]{8,})@ (line 84) / ([^@]{4,})@ (line 169) — stops at first @
Bypass: postgres://user:P@ssw0rd@host:5432/db — regex captures P not P@ssw0rd because it stops at the first @
Fix: Use ([^@\s]{4,}?)@[^@]*$ or similar to match against the last @ as the delimiter
4. Mixed-case environment variable names
Same root cause as #1 — My_Secret_Key=value bypasses the [A-Z_]* prefix requirement.
Severity
Medium — each bypass is individually exploitable. Combined they represent a significant gap in structural secret detection. Exploitable when agent tool output contains secrets in any of these formats.
Source
Fuzzer testing against sandbox hooks and Go security pipeline.
Reported by: @JimFuller-RedHat (via fuzzer testing)
Summary
Both the Python sandbox hook (
secret_redact_posttool.py) and Go-sideSecretRedactor(redactor.go) share four pattern bypasses that allow secrets to pass through unredacted. The patterns appear identical between both implementations.Affected files
internal/security/hooks/secret_redact_posttool.py:54-88internal/security/redactor.go:160-177Bypass vectors
1. Lowercase environment variable names
Pattern:
[A-Z_]*(?:SECRET|TOKEN|...)(line 59 / line 165) — uppercase onlyBypass:
export my_token=s3cr3t_value_here— lowercasemy_tokendoesn't match[A-Z_]*Fix: Add
(?i)flag or use[A-Za-z_]*for env var name prefix2. Single-quoted JSON values
Pattern:
"...(secret)..."(line 68 / line 166) — double quotes onlyBypass:
{'api_key': 'sk-proj-actual-secret-value'}— single quotes not matchedFix: Add single-quote variant
'...'alongside double-quote pattern3. Multiple
@in database connection stringsPattern:
([^@\s]{8,})@(line 84) /([^@]{4,})@(line 169) — stops at first@Bypass:
postgres://user:P@ssw0rd@host:5432/db— regex capturesPnotP@ssw0rdbecause it stops at the first@Fix: Use
([^@\s]{4,}?)@[^@]*$or similar to match against the last@as the delimiter4. Mixed-case environment variable names
Same root cause as #1 —
My_Secret_Key=valuebypasses the[A-Z_]*prefix requirement.Severity
Medium — each bypass is individually exploitable. Combined they represent a significant gap in structural secret detection. Exploitable when agent tool output contains secrets in any of these formats.
Source
Fuzzer testing against sandbox hooks and Go security pipeline.
Reported by: @JimFuller-RedHat (via fuzzer testing)