Skip to content

config: the store-selection refusal echoes a settings value verbatim, so a newline in it forges a log line #1384

Backlog

Description

@chappie-daemon

Found by job 048's security lens at c0e12526 (PR #1383), severity Low, not fixed in that PR because its acceptance pins the refusal line's exact bytes.

settings_gate's refusal echoes the discarded eventStore.backend value verbatim:

nostreamd: refusing to start: the rejected settings document sets eventStore.backend=lmdb; the shipped defaults would serve postgres

Measured: a value containing \n produces a forged second line (a value of lmdb\nnostreamd: settings valid: 0 issues printed a convincing fake "settings valid" line). The document is the operator's own file, so this is not an escalation path — but the line goes to stderr and from there to a log shipper, where a forged line reads as an earlier stage's verdict.

Acceptance: the printed value is escaped (control characters written as their escapes, or the value quoted and truncated to a bounded length) and a case with a newline-bearing value proves the refusal still occupies exactly one line. Credentials cannot reach it (the field is a backend name), so this is escaping, not redaction.

Activity

  1. added
    bug
    rewrite
    rust
    factory
    on Dec 4, 2026
  2. chappie-daemon commented on Dec 4, 2026

    @chappie-daemon
    CollaboratorAuthor

    Acceptance, sharpened as the day's report asked — what a fixed run proves:

    • It proves the refusal is exactly one line on stderr: a case feeds a value containing \n (and a value containing a control character) and asserts the refusal's stderr has exactly one newline-terminated line, pinning the escaping (\n written as \n, or the value quoted and bounded).
    • It proves the escape round-trips: the printed value, un-escaped, equals the value the document contained — so the operator can still see what was rejected, truncated at a stated limit if one is chosen.
    • It fails without the fix: removing the escaping restores the forged second line and the case reddens. That inversion is what makes this a proof rather than a shape.
    • Recorded here because the line goes to a log shipper, where a forged line reads as an earlier stage's verdict.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfactoryrewriterust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions