fix(dedupe): give Checkmarx Scan detailed a hash_code field list - #15580
Open
devGregA wants to merge 1 commit into
Open
fix(dedupe): give Checkmarx Scan detailed a hash_code field list#15580devGregA wants to merge 1 commit into
devGregA wants to merge 1 commit into
Conversation
"Checkmarx Scan detailed" is registered in DEDUPLICATION_ALGORITHM_PER_PARSER but has no HASHCODE_FIELDS_PER_SCANNER entry, so hash computation falls through to the legacy field set -- which includes `description`. A parser change that reworded a finding therefore moved its stored hash_code, which is exactly the fragility this list exists to prevent. The three fields are the ones "Checkmarx CxFlow SAST" already uses, and for the same reason: the detailed mode of this parser sets vuln_id_from_tool (queryId), file_path (sinkFilename) and line (sinkLineNumber) on every finding it produces, so all three are populated and none of them carries scan text. The algorithm for this scan type is unique_id_from_tool, so this moves the stored hash without changing how candidates are looked up. Deliberately not doing the same for "Checkmarx One Scan", which has the same missing entry. Its parser covers several result families and get_results_sca sets only title (copied from the description) and severity -- no file_path, no cwe, no line, no vuln_id_from_tool. Any declarable field list is therefore either low-entropy for those findings, which is worse than the legacy hash, or text-derived, which does not fix anything. It sets unique_id_from_tool reliably, so a durable identity is available without a configured hash. Verified: dojo.checks.check_configuration_deduplication returns no warnings with the entry in place, so both halves of the registration agree.
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.
Description
Checkmarx Scan detailedis registered inDEDUPLICATION_ALGORITHM_PER_PARSERbut has noHASHCODE_FIELDS_PER_SCANNERentry. Hash computation branches on the field list alone, so with noentry the scan type falls through to the legacy field set — which includes
description. A parserchange that reworded a finding therefore moved its stored
hash_code, which is precisely thefragility a declared field list exists to prevent.
The three fields are the ones
Checkmarx CxFlow SASTalready uses, and for the same reason: thedetailed mode of this parser sets
vuln_id_from_tool(queryId),file_path(sinkFilename) andline(sinkLineNumber) on every finding it produces, so all three are populated and none of themcarries scan text.
Blast radius
The algorithm for this scan type is
unique_id_from_tool, so candidates are looked up by vendor idrather than by hash. This moves the stored
hash_codewithout changing how findings are matched.Existing findings keep the hash they were stored with until a rehash recomputes them, and the
formula change is the kind a scoped rehash repairs — as distinct from a content change, which it
cannot.
Why
Checkmarx One Scanis deliberately not includedIt has the same missing entry, and the obvious fix is unsafe. Its parser covers several result
families, and
get_results_scasets onlytitle— copied from the description — andseverity:no
file_path, nocwe, noline, novuln_id_from_tool. So a list mirroring the siblingCheckmarx Scanentry (cwe,severity,file_path) would hash those findings on severityalone, collapsing distinct SCA findings onto one
hash_code— worse than the legacy hash itreplaced. A
title-based list avoids the collision but is description-derived for those samefamilies, so it fixes nothing.
That scan type does set
unique_id_from_toolreliably, so a durable identity is already availableto it without a configured hash. Closing it properly needs per-result-family handling in the
parser, not a settings entry, and is left as separate work.
Testing
dojo.checks.check_configuration_deduplicationreturns no warnings with the entry in place, soboth halves of the registration agree and
unittests/test_dedupe_config_checks.py'stest_shipped_configuration_is_cleanholds. Verified by calling the check directly against theedited settings, and with
ruff --config ruff.toml.Settings only. No code changes, no migration.