Skip to content

🎉 Advance reimport to update fix_available field #12633 #12922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

manuel-sommer
Copy link
Contributor

@manuel-sommer manuel-sommer commented Aug 4, 2025

#12633 (comment)

TODO: Documentation

@manuel-sommer
Copy link
Contributor Author

@valentijnscholten is this the right direction for updating fix_available in reimport?

@valentijnscholten
Copy link
Member

Yes

@manuel-sommer
Copy link
Contributor Author

Shall I target this against bugfix, or do we want a longer testphase and keep it against dev?

@github-actions github-actions bot added the docs label Aug 4, 2025
@manuel-sommer manuel-sommer marked this pull request as ready for review August 4, 2025 21:21
Copy link

dryrunsecurity bot commented Aug 4, 2025

DryRun Security

🔴 Risk threshold exceeded.

This pull request contains a potential data integrity issue in the default reimporter where an imported scan report can directly update the fix_available status of a security finding without server-side validation, which could lead to inaccurate security reporting. Additionally, sensitive edits were detected in the default_reimporter.py file.

🔴 Configured Codepaths Edit in dojo/importers/default_reimporter.py
Vulnerability Configured Codepaths Edit
Description Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml.
Data Integrity Issue in Finding Status in dojo/importers/default_reimporter.py
Vulnerability Data Integrity Issue in Finding Status
Description The fix_available status of an existing security finding is updated directly from an imported scan report via unsaved_finding.fix_available. There is no apparent server-side validation or verification of this flag. This allows a user-controlled input (the imported scan file) to directly influence a critical status field of a security finding. An attacker or a misconfigured scanner could falsely mark a finding as having a fix available, leading to inaccurate security posture reporting and potentially delaying the remediation of actual vulnerabilities.

# First check that the existing finding is definitely not mitigated
if not (existing_finding.mitigated and existing_finding.is_mitigated):
logger.debug("Reimported item matches a finding that is currently open.")
if unsaved_finding.fix_available:
logger.debug("Reimported finding has a fix available now.")
existing_finding.fix_available = True
if unsaved_finding.is_mitigated:
logger.debug("Reimported mitigated item matches a finding that is currently open, closing.")
# TODO: Implement a date comparison for opened defectdojo findings before closing them by reimporting,

We've notified @mtesauro.


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

@valentijnscholten
Copy link
Member

The main reason fields are not updated during reimport is that there's a risk it overwrites fields that were changed by the user. At least that's what I think the reason is. And this could be an issue here are the user may have set the fix_available field to None or False explicity. On the other hand we want to make that if a fix has become available we update the finding. What are your thoughts on this @Maffooch @mtesauro

@manuel-sommer
Copy link
Contributor Author

I mean that is what is requested also in the linked issue explicitly.

@valentijnscholten
Copy link
Member

We've discussed this and since this is sort of a "status" field or "meta" field it's OK to let reimport update it. Two remarks:

  • I think we would just always need to update it, so also the case where it goes from True to False (or to None)
  • I think it would have to be updated for any existing finding, so all branches of process_matched_finding.

@Maffooch
Copy link
Contributor

Maffooch commented Aug 7, 2025

We've discussed this and since this is sort of a "status" field or "meta" field it's OK to let reimport update it. Two remarks:

  • I think we would just always need to update it, so also the case where it goes from True to False (or to None)
  • I think it would have to be updated for any existing finding, so all branches of process_matched_finding.

I agree with this approach

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.

3 participants