fix(fortify): only flag suppressed FPR findings as false_p (reimport closing all findings) - #15839
Open
BrunoTerres wants to merge 1 commit into
Open
Conversation
FortifyFPRParser.compute_status checked `vulnerability.instance_id in related_data.suppressed`, but related_data.suppressed is a dict populated with an entry for every issue in audit.xml (value True OR False). Real Fortify reports include the full audit trail, so the membership check flipped every audited finding to active=False, false_p=True, and every reimport closed the whole test. Check the value instead of membership so only issues with suppressed="true" in audit.xml become false_p. Extend the existing suppressed-fixture test to assert that a finding present in audit.xml without suppressed="true" stays active — that assertion fails on the previous code and passes on the fix. Affects both Fortify Scan (v1) and Fortify Scan v2 (FortifyFPRParserV2 inherits compute_status). XML-only reports (no audit.xml) are unaffected.
valentijnscholten
approved these changes
Sep 1, 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.
Description
FortifyFPRParser.compute_status(used by both Fortify Scan and Fortify Scan v2) closes every audited finding on reimport, wiping valid findings from the test.Root cause
dojo/tools/fortify/fpr_parser.py::add_audit_logpopulatesrelated_data.suppressedwith one entry per issue inaudit.xml, storing the parsedsuppressedattribute as a boolean:compute_statusthen checked membership, not the value:Real Fortify reports include the full audit trail (every issue, most with
suppressed="false"), so every finding whoseinstance_idappeared inaudit.xmlwas set toactive=False, false_p=True. On the next reimport DefectDojo mitigates all "missing" active findings, closing valid findings across the test.XML-only reports (no
audit.xml) were unaffected becauserelated_data.suppressedstayed empty.Fix
Check the stored value instead of membership:
Two lines, no behavior change for genuinely suppressed issues or for reports without an audit trail.
FortifyFPRParserV2inheritscompute_status, so both scan types are fixed.Why this wasn't caught by existing tests
The existing fixture
unittests/scans/fortify/fortify_suppressed_with_comments.fprships anaudit.xmlthat only lists the one truly-suppressed issue plus one tagged issue — the other two findings'instance_ids never appear inaudit.xml, so the buggy membership check happened to returnFalsefor them and the test passed by accident.Scope of change
dojo/tools/fortify/fpr_parser.py— 2-line logic change incompute_status(+ short comment)unittests/tools/test_fortify_parser.py— added regression assertionsTest results
test_fortify_fpr_suppressed_findinginunittests/tools/test_fortify_parser.pywith a regression assertion for finding index 1 (instance_id="D3166922519EDD92D132761602EB71B4"), which is present in the fixture'saudit.xmlwithoutsuppressed="true"(audited-but-not-suppressed — the exact real-world case that broke). The new assertion fails on the previous code and passes on this change.unittests.tools.test_fortify_parsersuite: 14 tests, all pass (./run-unittest.sh --test-case unittests.tools.test_fortify_parser).ruff check --config ruff.tomlon both changed files: clean.false_pand the active set is preserved across reimports.Documentation
No documentation change required — this is a behavior-preserving bug fix in an existing parser. No new settings, models, migrations, or user-facing config.
Checklist
bugfix(bug fix →bugfixbranch, per the checklist).bugfix.