Skip to content

Make the triage baseline use the same fingerprint the scanner compares - #95

Merged
ParzivalHack merged 1 commit into
ParzivalHack:mainfrom
arpitjain099:fingerprint-hash-mismatch
Aug 25, 2026
Merged

Make the triage baseline use the same fingerprint the scanner compares#95
ParzivalHack merged 1 commit into
ParzivalHack:mainfrom
arpitjain099:fingerprint-hash-mismatch

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

Second of the two you invited on GHSA-7875-p889-5wvx, and independent of #94.

create_fingerprint() in triage.py:16 hashes with SHA-256, while the scanner computes get_fingerprint() with SHA-1 in _rust_core/src/issues.rs:69, over the identical rule_id|file_path|line_number|code string. The TUI writes its SHA-256 digests into .pyspector_baseline.json, and cli.py:903 then compares them against SHA-1 values, so nothing ever matches and a baseline saved from the triage view suppresses nothing.

I hit this by accident: a hand-built SHA-1 baseline dropped a finding while a SHA-256 one over the same string did not, which is what pointed at the mismatch.

Switching triage.py to SHA-1 makes the two agree. Going the other way and moving the Rust side to SHA-256 would work equally well, but it invalidates any baseline anyone has, whereas nothing can regress here since no TUI-written baseline was ever matched in the first place. Happy to do it that way instead if you prefer SHA-256.

I used AI assistance while working on this. I confirmed the two now agree over the same string rather than assuming it.

create_fingerprint() in triage.py hashes with SHA-256 while the scanner
computes get_fingerprint() with SHA-1 in _rust_core/src/issues.rs, over
the identical rule_id|file_path|line_number|code string. The TUI writes
its SHA-256 digests into .pyspector_baseline.json and cli.py then
compares them against SHA-1 values, so nothing ever matches and a
baseline saved from the triage view suppresses nothing.

Switch triage.py to SHA-1 so the two agree. No existing baseline written
by the TUI can regress, since none of them were ever matched.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@ParzivalHack ParzivalHack added the bug Something isn't working label Aug 25, 2026

@ParzivalHack ParzivalHack left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the PR, i obviously require no changes for this one, merging :)

@ParzivalHack
ParzivalHack merged commit 0a6e185 into ParzivalHack:main Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants