-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Bug description
When marking a finding as "risk accepted" there is an option to upload a file containing Proof.
Then once a user wishes to download the file, DefectDojo throws:
With the logs showing:
Steps to reproduce
Steps to reproduce the behavior:
- Go to findings and click on a findings hamburger menu
- Click on 'Add Risk Acceptance...'
- Scroll down to 'Proof' and upload an image (for example a screenshot)
- Click on 'Save' at the bottom of the page
- Go to the engagement that the finding was from and click on the specific "Risk Acceptance"
- Click on the entry under "Uploaded Proof"
- See error
Expected behavior
DefectDojo starts download/displays image
Deployment method (select with an X)
- Docker Compose
- GoDojo
- Kubernetes
Environment information
- Operating System: Alpine Linux
- Docker Compose: Docker Compose version v5.0.2
- DefectDojo version: v. 2.55.1 (but suspected code is present in 2.56.0 too)
Logs
uwsgi-1 | [09/Mar/2026 09:26:32] ERROR [django.request:253] Internal Server Error: /engagement/1/risk_acceptance/4/download
uwsgi-1 | Traceback (most recent call last):
uwsgi-1 | File "/usr/local/lib/python3.13/site-packages/django/core/handlers/exception.py", line 55, in inner
uwsgi-1 | response = get_response(request)
uwsgi-1 | File "/usr/local/lib/python3.13/site-packages/django/core/handlers/base.py", line 197, in _get_response
uwsgi-1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
uwsgi-1 | File "/app/dojo/authorization/authorization_decorators.py", line 36, in _wrapped
uwsgi-1 | return func(request, *args, **kwargs)
uwsgi-1 | File "/app/dojo/engagement/views.py", line 1584, in download_risk_acceptance
uwsgi-1 | (Path(settings.MEDIA_ROOT) / "risk_acceptance.path.name").open(mode="rb")))
uwsgi-1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
uwsgi-1 | File "/usr/local/lib/python3.13/pathlib/_local.py", line 537, in open
uwsgi-1 | return io.open(self, mode, buffering, encoding, errors, newline)
Additional context
I believe that the error stems from the following line:
django-DefectDojo/dojo/engagement/views.py
Line 1583 in 8270f98
| (Path(settings.MEDIA_ROOT) / "risk_acceptance.path.name").open(mode="rb"))) |
Reactions are currently unavailable