Skip to content

fix(sarif): publish the fingerprint under a namespaced key (v0.6.2) - #90

Merged
ralyodio merged 1 commit into
masterfrom
fix/sarif-fingerprint-key
Aug 10, 2026
Merged

fix(sarif): publish the fingerprint under a namespaced key (v0.6.2)#90
ralyodio merged 1 commit into
masterfrom
fix/sarif-fingerprint-key

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Release 0.6.2. Completes #89, which fixed half the problem.

What #89 missed

#89 replaced ruleId:file:line with a content hash. The stability half of that was right and stands. The warning was not fixed — the next real upload logged it again, now comparing against the new hash:

! Calculated fingerprint of 13bfd14c5cc763c:1 for file debtap line 104,
  but found existing inconsistent fingerprint value a279c9a6c714c186b820bdda081fe310

The collision is over the key, not the format. primaryLocationLineHash is computed by the CodeQL upload action itself, and it warns whenever the value it derived differs from one already present in the document. That is any value we supply, whatever it contains — a correct content hash included.

The fix

Publish under threatcrush/contentHash/v1 and leave primaryLocationLineHash unset.

GitHub then computes the fingerprint it wants and stops complaining; SARIF consumers that are not GitHub keep a stable identity from us. The version suffix means the hash input can change later without silently redefining what an existing value meant.

The hash function is unchanged from 0.6.1, so identities carry over — this is a key rename, not a re-fingerprint.

Verification

The test that asserted the value reached primaryLocationLineHash now asserts the opposite: the fingerprint appears under the namespaced key, and primaryLocationLineHash is absent. The other four fingerprint tests from #89 are unchanged and still pass — it is a hash, it survives a move from line 23 to line 891, it survives reindentation, and it still separates different rules, files and content.

105 tests pass. tsc --noEmit clean.

Confirmed against ralyodio/debtap after merge, which is where both warnings were observed.

Release 0.6.2.

0.6.1 made partialFingerprints a content hash and the inconsistent-
fingerprint warning kept appearing, now comparing against the new hash:

  Calculated fingerprint of 13bfd14c5cc763c:1 for file debtap line 104,
  but found existing inconsistent fingerprint value a279c9a6c714c186...

The collision is over the key, not the format. `primaryLocationLineHash`
is computed by the CodeQL upload action itself, and it warns whenever the
value it derived differs from one already present — which is any value we
supply, whatever it contains.

Publish under `threatcrush/contentHash/v1` instead. GitHub computes the
fingerprint it wants, other SARIF consumers keep a stable identity from us,
and the warning goes away. The version suffix leaves room to change the
hash input later without silently redefining an existing value.

The hash itself is unchanged from 0.6.1, so identities carry over.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

158 finding(s)

HIGH/CRITICAL: 14 | MEDIUM: 108 | LOW: 36

Severity Rule Location
HIGH sql-template-interpolation apps/cli/src/scan/__tests__/code-rules.test.ts:31
HIGH secret-aws-access-key apps/cli/src/scan/secret-rules.ts:192
HIGH js-shell-exec-interpolation modules/code-scanner/src/__tests__/sast.test.ts:31
HIGH js-shell-exec-interpolation modules/code-scanner/src/__tests__/sast.test.ts:102
HIGH js-shell-exec-interpolation modules/code-scanner/src/__tests__/sast.test.ts:108
HIGH secret-aws-access-key modules/code-scanner/src/secrets/rules.ts:74
HIGH secret-aws-access-key prd/0003-detect-hardcoded-secrets-before-they-are-committed-or-served.md:126
HIGH sh-eval-expansion .githooks/pre-commit:26
HIGH js-unsafe-yaml-load apps/cli/src/scan/__tests__/code-rules.test.ts:216
HIGH secret-generic-credential modules/spend-guard/config/example.conf.toml:13
HIGH secret-generic-credential modules/spend-guard/README.md:84
HIGH secret-generic-credential PRD.md:268
HIGH sh-remote-script-execution scripts/smoke-test.sh:46
HIGH sh-remote-script-execution scripts/smoke-test.sh:47
MEDIUM insecure-temp-file .githooks/commit-msg:16
MEDIUM insecure-temp-file .githooks/post-commit:20
MEDIUM js-shell-exec-interpolation apps/cli/src/commands/init.ts:70
MEDIUM js-shell-exec-interpolation apps/cli/src/commands/init.ts:79
MEDIUM sql-template-interpolation apps/cli/src/commands/properties.ts:226
MEDIUM js-shell-exec-interpolation apps/cli/src/commands/service.ts:88
MEDIUM js-shell-exec-interpolation apps/cli/src/commands/service.ts:111
MEDIUM sql-template-interpolation apps/cli/src/core/state.ts:121
MEDIUM sql-template-interpolation apps/cli/src/core/state.ts:125
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:31
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:33
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:34
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:35
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:36
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:43
MEDIUM sql-template-interpolation apps/cli/src/daemon/firewall/adapters.ts:49
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:49
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:56
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:63
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:82
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:84
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:85
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:93
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:98
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:105
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:112
MEDIUM sql-template-interpolation apps/cli/src/index.ts:105
MEDIUM sql-template-interpolation apps/cli/src/index.ts:110
MEDIUM sql-template-interpolation apps/cli/src/index.ts:120
MEDIUM js-shell-exec-interpolation apps/cli/src/index.ts:411
MEDIUM sql-string-concatenation apps/cli/src/scan/__tests__/code-rules.test.ts:21
MEDIUM sql-template-interpolation apps/cli/src/scan/__tests__/code-rules.test.ts:35
MEDIUM sql-string-concatenation apps/cli/src/scan/__tests__/code-rules.test.ts:40
MEDIUM sql-string-concatenation apps/cli/src/scan/__tests__/code-rules.test.ts:49
MEDIUM sql-string-concatenation apps/cli/src/scan/__tests__/code-rules.test.ts:53
MEDIUM js-shell-exec-interpolation apps/cli/src/scan/__tests__/code-rules.test.ts:65

…and 108 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 58e9eeb into master Aug 10, 2026
9 checks passed
@ralyodio
ralyodio deleted the fix/sarif-fingerprint-key branch August 10, 2026 17:50
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