Skip to content

SEC: Git delivery: redaction is shallow, ignores short credentials, and is order-sensitive for overlaps (Codex F2) #445

Closed

Description

@ephico2real2

Part of #286. Found by Codex (another model family) reviewing the Git delivery layer on main b8ee59e (PRs #288, #299), 2026-11-19. Severity per Codex: Medium.

Location: cmapi/src/cmapi/core/git/oplog.py:29, :36, :84.

Short configured credentials never register, and a dictionary nested in an event/list bypasses redaction. Iterating an unordered set can replace a shorter credential prefix before its longer registered value, leaving a suffix visible. The deterministic regression demonstrates the short/nested cases; the overlapping-prefix hazard follows from the replacement loop and is not claimed as a separately deterministic baseline failure.

Full fix: register all nonempty values, take a locked snapshot, use one longest-first escaped regex substitution, and recursively sanitize dictionary keys/values and sequences. Register the SSH key text as defense in depth. Parse raw Git stderr before sanitizing it, so a short credential such as t cannot change “couldn't find remote ref” or “stale info” into an unrecognizable classifier. Appendix C: oplog.py, relevant workspace.py hunks. The existing API-no-workspace test expectation now uses redact() because its token is deliberately t.

Test: test_nested_short_and_overlapping_secrets: fails main; passes fixed. Actual Git retry/adoption control passes with the new redactor. Limitation: substring redaction of a one-character credential necessarily makes some operator text harder to read.

Evidence: workbench/cmapi/review-288b/codex-report.md (F2) and its regression test in codex-fixes.patch; Codex ran it failing on main and passing with its fix. Reviewer 2 (OB3) checks the fix and runs the PostgreSQL and SSH checks the sandbox could not, before it is applied.

Activity

  1. added
    bug
    status:open
    sev:medium
    Backlog
    on Nov 19, 2026
  2. ephico2real2 commented on Nov 19, 2026

    @ephico2real2
    OwnerAuthor

    Fixed by #459 (merged, CI green), from Codex's review of the Git delivery layer with OB3's corrected fix; the coordinator ran its test failing on main and passing with the fix. GitHub closed only the first Closes line of that PR.

  3. added
    Done
    and removed
    Backlog
    on Nov 19, 2026
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

    Donebugsev:mediumstatus:open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions