Prevent reimport from reactivating duplicate findings as active/verified#14935
Open
valentijnscholten wants to merge 2 commits into
Open
Prevent reimport from reactivating duplicate findings as active/verified#14935valentijnscholten wants to merge 2 commits into
valentijnscholten wants to merge 2 commits into
Conversation
Fixes DefectDojo#14910. process_matched_mitigated_finding reactivated a matched mitigated finding without checking whether it is a duplicate, producing an invalid active/verified duplicate state that the finding edit form rejects. Keep duplicates inactive/unverified on reactivation (un-mitigate only), matching the set_duplicate invariant.
process_matched_mitigated_finding appends to self.reactivated_items, which is normally created in process_findings(). The tests drive the method directly, so set the accumulator lists explicitly.
dogboat
approved these changes
Jun 2, 2026
Jino-T
approved these changes
Jun 2, 2026
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.
Summary
active=true, verified=true, duplicate=true, which the finding edit form itself rejects (Duplicate findings cannot be verified or active).process_matched_mitigated_findingindojo/importers/default_reimporter.pyreactivated a matched mitigated finding by settingactive=True/verifiedwithout checking whether the finding is a duplicate, bypassing the invariant enforced byset_duplicate(active=False, verified=Falsefor duplicates). Postprocessing deduplication does not repair the state because the batch matcher skips findings already markedduplicate=True.active=False/verified=Falseon reactivation, so duplicates stay inactive as documented. Non-duplicate findings reactivate exactly as before. The reactivation note text reflects the duplicate case.ReimportDuplicateReactivationTest) covering both the duplicate path (stays inactive/unverified) and the regular path (still reactivates).