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
security(secrets): SecretSet misses a known value inside a larger base64 payload, hex and other common encodings #681
Found in the #594 security audit. Severity: medium. Status: confirmed (failing tests).
Affected code
crates/tole-core/src/secrets.rs:354forms(): needles are the raw value, its JSON-escaped form (serde's escaping), base64 standard/URL-safe of the value ALONE (offset 0, no padding) and percent-encoding.
Problem
Base64 output depends on the byte offset mod 3 and on the bytes around the value, so a known secret inside a larger base64 payload is not matched. That is the common case, not an edge case:
HTTP Basic base64("x-access-token:" + token) and git credential helpers,
base64 .env, Kubernetes manifests of whole env files.
Also missed: hex (xxd -p, od), JSON \/ and \uXXXX escapes produced by other encoders (Python ensure_ascii, PHP), and a value split by a zero-width character. Each of these reaches the provider, the log and every sink as is, and the web_fetch "URL carries a known secret" refusal is bypassed the same way.
Scenario
The agent runs cat ~/.docker/config.json or git config --get-regexp http.*extraheader while debugging CI; the Basic token holding GITHUB_TOKEN goes to the provider and into the durable log unredacted, although tole knows the value.
Base64: add the three shifted encodings (encode "x"+v, "xx"+v, drop the leading chars whose bits depend on the prefix and the trailing partial group) for standard and URL-safe alphabets: 6 extra needles per secret, still a byte scan.
Add lower/upper hex needles.
Normalize before matching: strip zero-width/format characters (-, , ), unescape \/ and \uXXXX in a scan copy with an offset map, or add those escaped forms as needles.
Activity