BlackDuck: Support import in plaintext or bytes#13033
Merged
valentijnscholten merged 2 commits intobugfixfrom Aug 24, 2025
Merged
BlackDuck: Support import in plaintext or bytes#13033valentijnscholten merged 2 commits intobugfixfrom
valentijnscholten merged 2 commits intobugfixfrom
Conversation
|
This pull request contains a potential uncontrolled resource consumption vulnerability in the
Uncontrolled Resource Consumption in
|
| Vulnerability | Uncontrolled Resource Consumption |
|---|---|
| Description | The zipfile.ZipFile constructor is called without being wrapped in a try...except block that specifically handles zipfile.BadZipFile or other exceptions related to malformed zip files. While zipfile.is_zipfile() is checked prior to this call, this function only performs a superficial check and does not guarantee the file's integrity or protect against 'zip bombs' or other maliciously crafted archives that could cause resource exhaustion or unhandled exceptions when the ZipFile object is instantiated. |
django-DefectDojo/dojo/tools/blackduck_component_risk/importer.py
Lines 42 to 48 in 9d87dc9
All finding details can be found in the DryRun Security Dashboard.
blakeaowens
approved these changes
Aug 22, 2025
paulOsinski
approved these changes
Aug 22, 2025
valentijnscholten
approved these changes
Aug 24, 2025
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.
I found that while doing some importing using python request, black duck zip files had to be imported with
rbmode in the files parameter:However, when attempting to process CSV files in this way, I would constantly get an exception for two reasons:
temporary_filefunction does not work well with bytesTo mitigate this, we need to support byte imports are a first class citizen. I checked the other black duck parsers as well to get them up to speed