-
Notifications
You must be signed in to change notification settings - Fork 1.8k
enhance/normalize EDITABLE_MITIGATED_DATA handling #13303
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
enhance/normalize EDITABLE_MITIGATED_DATA handling #13303
Conversation
This pull request exposes internal configuration details in API validation error messages by returning the flag name EDITABLE_MITIGATED_DATA=false in responses (reported in dojo/api_v2/serializers.py at two locations), which risks information disclosure that could aid attackers. Reviewers should remove or sanitize the flag from error messages to avoid leaking internal state.
Information Disclosure via Error Message in
|
Vulnerability | Information Disclosure via Error Message |
---|---|
Description | The application's API returns a validation error message that explicitly includes the name of an internal configuration flag, EDITABLE_MITIGATED_DATA=false . This exposes internal system details to the client, which can aid an attacker in understanding the application's configuration and internal logic. |
django-DefectDojo/dojo/api_v2/serializers.py
Lines 1786 to 1789 in 5f86e14
errors["mitigated"] = ["Editing mitigated timestamp is disabled (EDITABLE_MITIGATED_DATA=false)"] | |
if ("mitigated_by" in data) and (data.get("mitigated_by") is not None): | |
errors["mitigated_by"] = ["Editing mitigated_by is disabled (EDITABLE_MITIGATED_DATA=false)"] | |
if errors: |
Information Disclosure via Error Message in dojo/api_v2/serializers.py
Vulnerability | Information Disclosure via Error Message |
---|---|
Description | The application's API error messages explicitly reveal an internal configuration setting (EDITABLE_MITIGATED_DATA=false ). This provides unnecessary internal system details to API consumers, which could aid an attacker in understanding the system's configuration and potentially inform further reconnaissance or exploitation efforts. |
django-DefectDojo/dojo/api_v2/serializers.py
Lines 1940 to 1943 in 5f86e14
errors["mitigated"] = ["Editing mitigated timestamp is disabled (EDITABLE_MITIGATED_DATA=false)"] | |
if ("mitigated_by" in data) and (data.get("mitigated_by") is not None): | |
errors["mitigated_by"] = ["Editing mitigated_by is disabled (EDITABLE_MITIGATED_DATA=false)"] | |
if errors: |
All finding details can be found in the DryRun Security Dashboard.
I think this is a fine approach - one tests as passing, I'll approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Fixes #6078
I thought it would be nice to allow the Finding API to accept
mitigated
andmitigated_by
values for super users and whensettings.EDITABLE_MITIGATED_DATA
wasTrue
.This PR adds that. It also normalizes the check in all place.
Two notes:
mitigated
timestamp field if theEDITABLE_MITIGATED_DATA
was enabled. Not sure if this was intentional, but this PR now guards that field by the same central helper method. So only superusers can set if andEDITABLE_MITIGATED_DATA
must be enabled. Is this oké?It looked like a simple change at first, but these inconsistencies made it hard to find out what is/was the intended behaviour. Do we want to allow creation and updating of findings as mitigated without doing the close finding api call?
Users can do this in the Edit Finding feature of the UI, so I think it should be supported in the API as well.