Skip to content

Security close check leaves fixed findings open when the proof-of-concept test can't run #2333

Backlog

Description

@JacobStephens2

The Security close check leaves fixed findings open because it can't tell "the fix holds" from "the proof-of-concept test no longer runs". Since 2026-10-30, 20 Security runs across 11 of my repos merged their fix and then left the private record open with "the proof-of-concept test did not pass against the merged Base branch". By my reading of the logged reasons, at most 3 of the 20 suggest the finding may still reproduce. The other 17 are test failures that say nothing about the fix, and each one lands on me as an open record to re-verify by hand.

Evidence

Counts from the Security close left open lines in ~/.thirdshift/logs/*/*/commands/secure/*.log on stephens.page and thirdshift.app. Repo names and finding details stay out of this public issue; the dated runs are in my fleet notes.

Shape Runs Dates
Test asserts the vulnerable behaviour, so it fails once the fix lands (polarity) 3 11-15, 11-15, 11-22
Test is coupled to code or fixtures the fix refactored (renamed function, removed file, regex on old structure, new input validation, fixture guard) 8 11-01, 11-05, 11-12, 11-13, 11-14, 11-16, 11-17, 11-17
Test can't run in the check's environment (missing bootstrap include, 422 on a setup request, no /dev/kvm, a gh fake rejecting a call, a failed control) 6 10-30, 11-08, 11-18, 11-22, 11-23, 11-23
May still reproduce (flaky 10 of 21, state unchanged after the fixed path, stand-in still overwrites) 3 11-11, 11-14, 11-15

Root cause

Two prompts disagree about what the test asserts, and the check has only two outcomes.

  • security_reproduction (src/prompt.rs:1150) asks for "a proof-of-concept test" that "reproduces the finding" and never states its polarity. Harnesses often write it so that it exits 0 when the attack succeeds.
  • security_close_check (src/prompt.rs:1168) assumes "The test failed before the fix" and asks whether it "now passes". A test written the other way round fails on fixed code, and the check records that as not fixed.
  • The check re-runs the recorded test verbatim ("Do not fix or change repository source"). A test that no longer compiles against refactored internals, or whose setup breaks, has no path except Security close check: fails:.
  • close_after_merge (src/security.rs:365) maps every non-pass to the same leave_open note, so "still vulnerable" and "could not verify" look identical in the record and in the Activity log.

Proposed fix

  1. Pin the polarity at reproduction. security_reproduction should require a regression test that fails while the code is vulnerable and passes once it is fixed, with a control case that passes either way. It should also record the test's expected result on the untouched code in the private record.
  2. Give the close check three outcomes: passes, still reproduces: <evidence>, and inconclusive: <reason>. Let the session adapt the test (test files only, never repository source) to renamed or refactored internals, and to setup that changed, as long as it still exercises the recorded attack. It should report the diff it made.
  3. Treat inconclusive differently from still reproduces. On inconclusive, retry once with a fresh session. If it is still inconclusive, leave the record open with a note that says "could not verify", distinct from "still reproduces", so a person can tell which open records need real attention.
  4. Test it in tests/security_run.rs beside the existing Security close left open assertion (line 1740): a polarity-inverted test that is adapted and then passes, an inconclusive check that is retried, and a still-reproduces check that leaves the record open.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions