Skip to content

Fix Nuclei deduplication across multiple endpoints - #15851

Open
Jaimin2687 wants to merge 3 commits into
DefectDojo:bugfixfrom
Jaimin2687:fix/nuclei-reimport-dedup-12397
Open

Fix Nuclei deduplication across multiple endpoints#15851
Jaimin2687 wants to merge 3 commits into
DefectDojo:bugfixfrom
Jaimin2687:fix/nuclei-reimport-dedup-12397

Conversation

@Jaimin2687

@Jaimin2687 Jaimin2687 commented Sep 2, 2026

Copy link
Copy Markdown

Fixes #12397

Description
This PR addresses the issue where Nuclei findings from different hosts were being incorrectly deduplicated into a single finding.

Root Cause
Protocol-less URLs (e.g. amazon.com) caused urlparse(matched).hostname to return None in dojo/tools/nuclei/parser.py. This resulted in different hosts sharing the same dupe_key, which in turn collapsed them into a single hash_code during dedup — merging findings that should have remained distinct.

Fix
Pre-pend // to protocol-less URLs before urlparse() so the hostname is correctly extracted. This mirrors the existing pattern used for LocationData construction on line 91 of the same file.

With this fix, urlparse("//amazon.com").hostname correctly returns "amazon.com" (instead of None), and each host produces a distinct dupe_key → distinct hash_code → no incorrect deduplication.

Checklist

  • Bug fix verified — different hosts now produce distinct hash codes.
  • Ruff lint checks passed.

…12397)

This commit addresses the issue where Nuclei findings from different hosts were incorrectly deduplicated into a single finding. Two main fixes were implemented:

1. dojo/tools/nuclei/parser.py: Fixed dupe_host extraction for protocol-less URLs by parsing them similarly to how LocationData operates, ensuring different hosts generate distinct dupe_key values.

2. dojo/importers/default_reimporter.py & dojo/finding/deduplication.py: Added endpoint differentiation via are_locations_duplicates during re-import matching to prevent incorrect merging of findings with identical hash codes but distinct endpoints. Extended finding_locations to correctly parse LocationData DTOs.
@dryrunsecurity

dryrunsecurity Bot commented Sep 2, 2026

Copy link
Copy Markdown

DryRun Security

This pull request contains critical findings because the user 'Jaimin2687', who is not on the allowed authors list, modified sensitive codepaths in dojo/finding/deduplication.py and dojo/importers/default_reimporter.py.

🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in dojo/finding/deduplication.py (drs_eb277c9b)
Vulnerability Configured Sensitive Codepath Modified by Non-Allowed Author
Description File 'dojo/finding/deduplication.py' matches configured sensitive codepath pattern 'dojo/finding/*.py' and was modified by 'Jaimin2687' (commit d5f8c60) who is not in the allowed authors list.
🔴 Configured Sensitive Codepath Modified by Non-Allowed Author in dojo/importers/default_reimporter.py (drs_60f4c536)
Vulnerability Configured Sensitive Codepath Modified by Non-Allowed Author
Description File 'dojo/importers/default_reimporter.py' matches configured sensitive codepath pattern 'dojo/importers/*.py' and was modified by 'Jaimin2687' (commit d5f8c60) who is not in the allowed authors list.

We've notified @mtesauro.


Comment to provide feedback on these findings.

Report false positive: @dryrunsecurity fp [FINDING ID] [FEEDBACK]
Report low-impact: @dryrunsecurity nit [FINDING ID] [FEEDBACK]

Example: @dryrunsecurity fp drs_90eda195 This code is not user-facing

All finding details can be found in the DryRun Security Dashboard.

The are_locations_duplicates check in match_finding_to_candidate_reimport
incorrectly rejected hash_code matches between findings in the same report
that have different endpoints but should merge (endpoint accumulation).

This broke test_reimport_prefetch tests that rely on same-hash findings
within one report being matched so their endpoints accumulate on a single
finding.

The parser fix (dupe_host extraction for protocol-less URLs) alone is
sufficient to resolve DefectDojo#12397 — it ensures different hosts produce
distinct hash codes, preventing incorrect deduplication at the source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant