The vacuous green
Here is a pattern that has cost real teams real months: a fix lands with a test named test_no_longer_vulnerable, the test passes in CI, the ticket closes. Later, someone reverts the fix and the test still passes it never depended on the fix. The test was asserting nothing about the vulnerability; it was green before, during, and after. We call this a vacuous green, and the only way to detect it mechanically is to run the test against a build that provably contains the bug.
A repro that cannot fail is not a repro. The pre-patch quadrant exists to falsify your own test before an attacker does it for you.
The four quadrants
| Vulnerability repro | Functional invariants | |
|---|---|---|
| Pre-patch build (parent commit) | Must FAIL proves the repro can detect the bug (non-vacuous) | Must PASS establishes the baseline was healthy before your change |
| Post-patch build (fix commit) | Must PASS proves the fix blocks the demonstrated attack | Must PASS proves the fix did not over-block legitimate behavior |
Each cell failure has a distinct meaning and a distinct owner:
| Failed cell | Meaning | Action |
|---|---|---|
| Q1 pre-patch repro passed | Vacuous repro, it never depended on the bug | Rewrite the repro; do not merge |
| Q2 pre-patch invariants failed | Baseline was already broken | Bisect separately; the fix PR is the wrong vehicle |
| Q3 post-patch repro failed | The fix does not block the attack | Fix the fix; obviously do not merge |
| Q4 post-patch invariants failed | Over-blocking / collateral behavior change | Narrow the fix or accept and document the behavior change explicitly |
Q1 is the anti-flake anchor. A repro that flakes between pass and fail pre-patch will also flake post-patch; the quadrant framing converts "sometimes red" into a deterministic merge blocker, forcing the repro to be made deterministic (seeded, clock-frozen, hermetic) before it can guard anything.
Wiring it into CI
The two builds come from the merge-base: the fix commit, and its parent. The repro and invariant suites run against both artifacts; a final job folds the four exit codes into one verdict.
jobs:
build:
strategy:
matrix:
target: [patched, baseline]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- if: matrix.target == 'baseline'
run: git checkout HEAD~1 # parent commit: provably contains the bug
- run: make build # artifact per matrix leg
- run: bin/run-repro-suite --sarif repro.json
- run: bin/run-invariants --sarif invariants.json
- uses: actions/upload-artifact@v4
with: { name: quad-${{ matrix.target }}, path: '*.json' }
verdict:
needs: build
steps:
- run: bin/quad-verdict # reads all four artifact results
# exit 0 - all four quadrants as required
# exit 10 - vacuous repro (Q1)
# exit 11 - post-patch repro still fails (Q3)
# exit 12 - invariant regression (Q4)
# exit 13 - dirty baseline (Q2)
- uses: github/codeql-action/upload-sarif@v3
if: always()
with: { sarif_file: quad-verdict.sarif }
SARIF 2.1.0 output
The verdict lands where review happens, as code-scanning results attached to the fix diff. Each quadrant is a result with a rule that encodes its semantics:
{
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"version": "2.1.0",
"runs": [{
"tool": { "driver": { "name": "sarif-patch-verifier", "version": "1.0.0" } },
"results": [
{
"ruleId": "QUAD1_VACUOUS_REPRO",
"level": "error",
"message": { "text": "Vulnerability repro PASSED against the pre-patch build; it does not depend on the fixed defect." },
"locations": [{ "physicalLocation": { "artifactLocation": { "uri": "tests/repro/auth_bypass.py" } } }],
"properties": { "quadrant": "pre_patch+vuln", "expected": "fail", "observed": "pass" }
},
{
"ruleId": "QUAD4_INVARIANT_REGRESSION",
"level": "error",
"message": { "text": "2 of 214 functional invariants failed post-patch: legacy-client handshake, streaming content-range." },
"properties": { "quadrant": "post_patch+invariants", "failed": 2, "total": 214 }
}
]
}]
}
Stable ruleIds matter more than prose: they let you trend quadrant failures over time and answer, with a query, "how many of our security tests were vacuous last quarter?"
Costs and limits
- Runtime doubles for the suites you gate this way. In practice you gate only security repros and their owned invariants, not the whole functional suite, a bounded, explicit list per fix.
- Baseline drift: Q2 failures spike when
HEAD~1itself was mid-refactor. The remedy is procedural, not technical, the verdict names the failing invariant; the fix PR rebases or the invariant is quarantined with a tracked issue. - It proves blocking, not absence. Four green quadrants say: this demonstrated attack is blocked, and these declared invariants held. It says nothing about attacks you did not encode, pair it with the probing and measurement notes in this series.
Status
The matrix runner, four-way verdict logic, and SARIF emitter described here are packaged as Silvauren/sarif-patch-verifier. It is CI-provider agnostic: anything that can run a command and upload an artifact can host it.