Repository navigation
Match Security finding fingerprints canonically on lookup - #2236
Merged
Merged
Conversation
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1527
Summary
Security runs and Security reviews now canonicalize finding fingerprints on lookup, so a renamed separator style or reordered token sequence reuses the existing repository record instead of creating a duplicate advisory or private issue or triggering another reproduction.
src/github/advisories/description.rs):Description::matches_fingerprintcompares case-foldedBTreeSet<String>token sets produced bycanonical_tokensacrossFingerprint: \...`` lines, falling back to exact comparison when separator-only candidates have empty token sets.src/github/advisories.rs): Both Security audits and Security reviews route throughSecurityRecords::record_or_reuse, keeping existing draft/published/closed advisories andneeds-triage/Day-shift-graded privatesecurity-findingissues within the repository without passing existing records to sessions or adding fuzzy title matching.src/security/findings.rs):Findings::recordnow inserts the resolved record URL (url.clone()) rather than rawfinding.fingerprintintoseen, skipping duplicate reproduction scheduling and duplicate completed-reproduction log lines when one audit emits canonically equivalent variants.docs/guide.md,site/docs/index.html): Updated## Security runsand### Security reviewto document canonical token-set lookup and verbatim fingerprint persistence, and regeneratedsite/docs/index.htmlvianpm run docs --prefix site.Evidence
Execution evidence
cargo test --bin thirdshift advisories::tests):canonical_fingerprints_reuse_records_and_preserve_written_fingerprintsfailed withcalled Result::unwrap() on an Err value: canonical match must not create another recordatsrc/github/advisories_tests.rs:572:18.After:
23 passed; 0 failed; 0 ignored; 1905 filtered out.cargo test --bin thirdshift security::tests):canonical_fingerprints_reuse_records_and_deduplicate_within_an_auditfailed withassertion left == right failed: private false: left: 1 right: 2atsrc/security/tests/sequence.rs:604:9.After:
21 passed; 0 failed; 0 ignored; 1907 filtered out.cargo test --test security_run reformatted_audit_fingerprints_reuse_records_and_skip_repeat_reproduction): failed withleft: Some(1) right: Some(0)attests/security_run.rs:5693:9after creating duplicateGHSA-test-test-0002andGHSA-test-test-0003.After:
1 passed; 0 failed; 0 ignored; 132 filtered out.cargo test --test security_review reformatted_pre_existing_review_fingerprints_reuse_records_and_keep_written_fingerprints): failed withleft: 3 right: 2attests/security_review.rs:1797:17after creating duplicateGHSA-test-test-0002.After:
1 passed; 0 failed; 0 ignored; 41 filtered out.a82fce8a:scripts/affected-tests main: passednpm test --prefix site(76.94s) and stopped fail-fast duringcargo nextest run(1389/4629 tests run: 1388 passed (7 slow), 1 failed, 207 skippedin1578.852s) onthirdshift::plan_usage plan_usage_shows_configured_routes_in_order_and_omits_api_key_and_unused_harnesses(tests/plan_usage.rs:322:5, ambientPATHpicking up host/home/jacob/.local/bin/agy)cargo nextest run --no-fail-fast --show-progress=counter --status-level=fail --final-status-level=slow --failure-output=immediate-final:4629 tests run: 4628 passed (15 slow), 1 failed, 207 skippedin2905.922s(sole failure:thirdshift::plan_usage plan_usage_shows_configured_routes_in_order_and_omits_api_key_and_unused_harnessesattests/plan_usage.rs:322:5under ambientPATH)PATH="/home/jacob/.cargo/bin:/usr/local/bin:/usr/bin:/bin" cargo test --test plan_usage:7 passed; 0 failed; 2 ignoredin15.09s(confirms host/home/jacob/.local/bin/agycaused the ambient-PATHfailure)cargo fmt --check,cargo clippy --all-targets -- -D warnings,python3 scripts/generate-release.py --check,npm run docs:check --prefix site: exited 0python3 -m unittest discover -s scripts -p 'test_*.py':Ran 65 tests in 26.907s OKnpm test --prefix site:tests 69,pass 69,fail 0(88278.946028ms)cargo test --bin thirdshift advisories::tests:23 passed; 0 failed; 0 ignored; 1905 filtered outcargo test --bin thirdshift security::tests:21 passed; 0 failed; 0 ignored; 1907 filtered outcargo test --bin thirdshift prompts_page:14 passed; 0 failed; 0 ignored; 1914 filtered outcargo test --test process security_review:16 passed; 0 failed; 0 ignored; 230 filtered outcargo test --test security_review:40 passed; 0 failed; 2 ignored(support::child_lifetime::fixture_guardian,support::child_lifetime::scenario_root_guardian)cargo test --test security_run:131 passed; 0 failed; 2 ignored(support::child_lifetime::fixture_guardian,support::child_lifetime::scenario_root_guardian)Visual evidence
Manual
#security-runsand#security-reviewrendered fromsite/docs/index.html(c0b4f35cvsa82fce8a), 1440×900 desktop:Manual
#security-runsand#security-review, 390×844 phone:Unaddressed findings
Standards
Spec
Security
Review coverage
site/docs/index.htmlonly (excluded as generated manual output; its sourcesdocs/guide.mdandsite/generate-docs.mjswere reviewed,site/docs/index.htmlwas regenerated withnpm run docs --prefix site, andnpm run docs:check --prefix siteplusnpm test --prefix sitepass).docs/guide.md,src/github/advisories/description.rs,src/github/advisories_tests.rs,src/security/findings.rs,src/security/tests/sequence.rs,tests/security_review.rs, andtests/security_run.rs) on commita82fce8aagainstrefs/remotes/origin/main(c0b4f35c).Security review outcome
No unaddressed introduced findings.
Merge Danger
Door: two-way
Reverting restores exact
Fingerprint: \...`` line matching and raw-fingerprint intra-audit tracking; newly written records continue to store fingerprints verbatim.Blast Radius: Security audit, Security review, manual
.,:,/,-,_, and whitespace and lowercased) match an existing advisory or privatesecurity-findingissue reuse that record rather than creating a new one or repeating reproduction.Built with agy 1.5.2 · gemini-4-hydrogen-xhigh · default effort