Repository navigation
Description
Priority: P1, from the 2026-11-25 security audit. Related feature: #232.
A secret containing a newline is not masked by the log shipper, even when the container has the correct sk.secret_env metadata. Docker output is split into individual lines before the redactor searches for the complete secret value, so the complete multiline value never matches any one line.
Audited revision: 1295e534d7a1c3cd0a492449de8806aa532a4924. The affected functions are unchanged from the #464 revision used for the Docker reproduction.
Preconditions and impact
- A managed container has a multiline secret injected as an environment variable and is correctly labelled for redaction.
- The application prints the value as received.
- Log shipping is enabled.
All lines of the value can leave the agent intact, allowing the original secret to be reconstructed from the collected output. The normal log query path permits readers with environment.read to read that output. This can affect multiline credentials, including key material, without any cross-organization access.
This differs from an application deliberately encoding or transforming a secret: the reproduction printed the original value unchanged. The line separation occurred in the logging pipeline. It also occurs on a newly created container, independently of missing metadata on legacy containers.
Cause
environment()accepts newline-containing secret values; its checks reject NUL and oversized values, not newlines.docker/logs.go:102–109separates the output into log lines.shipper.go:227–234applies redaction separately to each resulting line.Redactor.Redact()searches for the full environment value, including its newline, withstrings.ReplaceAll.
Verification
A disposable real Docker container was created with sk.secret_env=TOKEN and a synthetic two-line secret. Both lines were longer than the documented eight-byte redaction threshold. The container printed the variable unchanged. The real Docker client, framing code and Shipper.Run emitted two unredacted entries. Joining the emitted lines with a newline reproduced the exact original secret.
The bounded test passed with -race. A positive-control container with a labelled single-line secret emitted [redacted] as expected. Containers had no network, a read-only root, a non-root user and a 32 MiB memory limit, and were removed afterwards.
The proof captures batches at the shipper's outbound stream boundary. It does not claim a separately executed gateway/VictoriaLogs/browser test. No real credential, private key or production log was used.
Expected correction and acceptance
- Define and implement bounded redaction that protects accepted multiline secret values before any constituent sensitive text is emitted. Explicitly document the remaining limitations.
- Add a real Docker regression covering a labelled multiline environment secret printed unchanged; outbound output must not reconstruct the secret.
- Cover line boundaries, Docker partial frames, CRLF handling and interleaved stdout/stderr without joining unrelated output incorrectly.
- Add boundary tests around the 16 KiB truncation limit so truncation cannot expose an otherwise masked value or its sensitive prefix. This adjacent boundary is a regression requirement, not a separate demonstrated exploitation claim in this issue.
- Preserve bounded memory, cancellation, cursor/replay behavior and the documented handling of short values and application-transformed values.
Activity