Fix: Apply tags to findings/endpoints when TRACK_IMPORT_HISTORY is disabled#13969
Merged
valentijnscholten merged 1 commit intoDefectDojo:devfrom Dec 29, 2025
Conversation
…sabled Fixes DefectDojo#13312 When TRACK_IMPORT_HISTORY is disabled, tags were not being applied to findings and endpoints during import because the tag application logic was inside update_import_history() which returned early. Refactored to: - Extract tag application into dedicated apply_import_tags() method - Call apply_import_tags() from importers after update_import_history() - Remove tag application logic from update_import_history() This ensures tags are applied regardless of TRACK_IMPORT_HISTORY setting while maintaining separation of concerns.
|
This pull request introduces code that materializes all input iterables (notably large QuerySets like untouched_findings) into in-memory lists in apply_import_tags, which can bypass Django's lazy loading and lead to excessive memory use and an Out‑of‑Memory DoS risk on high-volume instances. While marked non-blocking, this change should be addressed to avoid potential memory exhaustion.
DoS via Memory Exhaustion in
|
| Vulnerability | DoS via Memory Exhaustion |
|---|---|
| Description | The apply_import_tags method forces the materialization of all input iterables, including potentially very large QuerySets of untouched_findings (representing all non-closed findings in a re-import), into in-memory Python lists. This bypasses Django's lazy loading, leading to excessive memory consumption and a high risk of Out-of-Memory Denial of Service (OOM DoS) in high-volume DefectDojo instances. |
django-DefectDojo/dojo/importers/base_importer.py
Lines 350 to 353 in d5bdf84
All finding details can be found in the DryRun Security Dashboard.
Maffooch
approved these changes
Dec 25, 2025
blakeaowens
approved these changes
Dec 27, 2025
Jino-T
approved these changes
Dec 29, 2025
valentijnscholten
added a commit
to valentijnscholten/django-DefectDojo
that referenced
this pull request
Dec 29, 2025
…sabled (DefectDojo#13969) Fixes DefectDojo#13312 When TRACK_IMPORT_HISTORY is disabled, tags were not being applied to findings and endpoints during import because the tag application logic was inside update_import_history() which returned early. Refactored to: - Extract tag application into dedicated apply_import_tags() method - Call apply_import_tags() from importers after update_import_history() - Remove tag application logic from update_import_history() This ensures tags are applied regardless of TRACK_IMPORT_HISTORY setting while maintaining separation of concerns.
Maffooch
pushed a commit
to valentijnscholten/django-DefectDojo
that referenced
this pull request
Feb 16, 2026
…sabled (DefectDojo#13969) Fixes DefectDojo#13312 When TRACK_IMPORT_HISTORY is disabled, tags were not being applied to findings and endpoints during import because the tag application logic was inside update_import_history() which returned early. Refactored to: - Extract tag application into dedicated apply_import_tags() method - Call apply_import_tags() from importers after update_import_history() - Remove tag application logic from update_import_history() This ensures tags are applied regardless of TRACK_IMPORT_HISTORY setting while maintaining separation of concerns.
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.
Fixes #13312
Problem
When
TRACK_IMPORT_HISTORYis disabled, tags were not being applied to findings and endpoints during import because the tag application logic was insideupdate_import_history()which returned early when the setting was disabled.Solution
Refactored the code to:
apply_import_tags()methodapply_import_tags()from importers afterupdate_import_history()update_import_history()This ensures tags are applied regardless of the
TRACK_IMPORT_HISTORYsetting while maintaining separation of concerns and eliminating code duplication.Changes
dojo/importers/base_importer.py: Addedapply_import_tags()method and removed tag logic fromupdate_import_history()dojo/importers/default_importer.py: Added call toapply_import_tags()afterupdate_import_history()dojo/importers/default_reimporter.py: Added call toapply_import_tags()afterupdate_import_history()