Skip to content

fix(dedupe): drop description from the Tenable Scan hash_code fields - #16013

Open
Eljees wants to merge 1 commit into
DefectDojo:bugfixfrom
Eljees:fix/11994-tenable-hashcode-drop-description
Open

Eljees wants to merge 1 commit into
DefectDojo:bugfixfrom
Eljees:fix/11994-tenable-hashcode-drop-description

Conversation

@Eljees

@Eljees Eljees commented Sep 20, 2026

Copy link
Copy Markdown

Fixes #11994

The defect

HASHCODE_FIELDS_PER_SCANNER["Tenable Scan"] includes description. Tenable puts scan-run data in that field — timestamps, the hosts the plugin fired on — so two scans of the very same vulnerability produce two different descriptions, and therefore two different hash_code values. Deduplication then never matches a finding against its own earlier occurrence, and every reimport creates a new finding.

The other four fields in the entry (title, severity, vulnerability_ids, cwe) are stable properties of the vulnerability itself. Dropping description leaves the entry identical to the Nexpose Scan one, which is the same class of network scanner.

The change

One line in dojo/settings/settings.dist.py, plus a regression test in unittests/test_dedupe_config_checks.py that asserts description stays out of the Tenable entry and says why.

What I ran

Python 3.13, unittests/test_dedupe_config_checks.py (a SimpleTestCase, so no database is needed):

  • with the change: 7 tests, all pass
  • control — description put back into the Tenable entry: 7 tests, 1 failure, the new test, with AssertionError: 'description' unexpectedly found in ['title', 'severity', 'vulnerability_ids', 'cwe', 'description']

So the test fails without the fix and passes with it.

Note on existing data

This changes how the hash_code of new Tenable findings is computed. Findings already stored keep their old hash until they are recomputed, which is the same situation as any other change to HASHCODE_FIELDS_PER_SCANNER. Happy to add a note to the upgrade documentation if you would like one for this release.

Tenable's description field carries per-scan data - timestamps and affected
hosts - that differs between two scans of the very same vulnerability. Because
it is part of HASHCODE_FIELDS_PER_SCANNER, the hash_code changes on every
reimport and the finding never deduplicates against its own earlier occurrence.

The remaining fields (title, severity, vulnerability_ids, cwe) are stable
properties of the vulnerability and already match the Nexpose Scan entry.

Fixes DefectDojo#11994

Signed-off-by: Elaria <3.14hell@gmail.com>
@github-actions github-actions Bot added settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR unittests labels Sep 20, 2026
@Maffooch Maffooch added this to the 3.3.300 milestone Sep 21, 2026

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

settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR unittests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants