Skip to content

fix(sarif): store finding fingerprint in fingerprints to prevent code scanning warning - #466

Open
Tyagiquamar wants to merge 1 commit into
boostsecurityio:mainfrom
Tyagiquamar:fix/387-sarif-fingerprint
Open

Tyagiquamar wants to merge 1 commit into
boostsecurityio:mainfrom
Tyagiquamar:fix/387-sarif-fingerprint

Conversation

@Tyagiquamar

@Tyagiquamar Tyagiquamar commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

SARIF uploaded to GitHub code scanning no longer warns that partialFingerprints.primaryLocationLineHash does not match GitHub's own line hash.

Root cause

The finding fingerprint was stored in partialFingerprints.primaryLocationLineHash. SARIF 2.1.0 reserves that field for a hash of the source line. GitHub computes that hash itself and warns when the uploaded value differs.

Solution

The finding fingerprint is stored on result.fingerprints under findingFingerprint. The reserved line-hash field is left for GitHub.

Test plan

formatters/sarif/sarif_test.go checks the fingerprint location in the emitted SARIF.

… scanning line hash warning

In SARIF 2.1.0 and GitHub Code Scanning, partialFingerprints.primaryLocationLineHash
is reserved for a hash of the code line containing the finding location. When
uploading to GitHub Code Scanning via upload-sarif, GitHub computes its own line hash
and warns when an inconsistent value is found under primaryLocationLineHash.

Store the finding fingerprint in result.fingerprints (under findingFingerprint)
instead of using the reserved primaryLocationLineHash key in partialFingerprints,
allowing GitHub Code Scanning to automatically generate the location line hash without warnings.

Fixes boostsecurityio#387.
@Tyagiquamar
Tyagiquamar requested a review from a team as a code owner October 22, 2026 12:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant