You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dlp: EgressSecretCheck and RedactReadPlan both leave DLP coverage gaps that let secrets through #103
Two related gaps in packages/guard/dlp/redact.go let secrets reach egress unredacted.
EgressSecretCheck (redact.go:67) parses the destination with url.Parse and only applies its host/scheme allowlist logic when a scheme is present. A scheme-less destination such as example.com/webhook or a bare IP is not recognized as a URL, so the function silently skips the egress check instead of treating it as untrusted.
RedactReadPlan (redact.go:224) only redacts the first matching key when a plan contains multiple locations for the same secret pattern. Any subsequent occurrence of the same secret elsewhere in the payload is left intact.
Impact
A scheme-less destination bypasses secret-egress blocking entirely, and even when a destination is checked, a payload with the same secret duplicated in two fields will leak the second copy. Both are silent, security-relevant bypasses of the DLP path.
Repro
Call EgressSecretCheck with a destination string like internal-collector.example.com/ingest (no http:// prefix). Observe it returns no match even though the same host with a scheme would be flagged.
Build a read plan whose body contains the same API key in two different JSON fields and pass it to RedactReadPlan. Observe only the first field is redacted in the output.
Suggested fix
In EgressSecretCheck, normalize the destination before parsing: if url.Parse yields an empty Host, retry with a // prefix prepended (or use net/url's opaque-handling pattern) so bare host:port and host/path forms resolve to a host the same way a scheme-qualified URL would. In RedactReadPlan, change the redaction loop from stopping at the first match to iterating all matches for each pattern/key pair, redacting every occurrence found in the plan.
I'll audit both EgressSecretCheck and RedactReadPlan to identify and close the coverage gaps. I'll add a comprehensive test suite with known secret patterns in various encodings (plain, base64, hex) and verify that both paths catch all of them.
Activity
sharmis-tp commentedon Nov 18, 2026
I'll audit both EgressSecretCheck and RedactReadPlan to identify and close the coverage gaps. I'll add a comprehensive test suite with known secret patterns in various encodings (plain, base64, hex) and verify that both paths catch all of them.