Skip to content

SLA Calculations: Remove product grade calculation and consolidate task handlers#13630

Merged
Maffooch merged 4 commits intoDefectDojo:bugfixfrom
Maffooch:sla-get-period
Nov 7, 2025
Merged

SLA Calculations: Remove product grade calculation and consolidate task handlers#13630
Maffooch merged 4 commits intoDefectDojo:bugfixfrom
Maffooch:sla-get-period

Conversation

@Maffooch
Copy link
Copy Markdown
Contributor

@Maffooch Maffooch commented Nov 5, 2025

When reviewing the SLA calculation functions, I was confused by the two helper functions and consolidated them. Additionally, I noticed the product grade calculation may be wasted compute. The SLA of a finding is not considered as part of the product grade, so no reason to the recalculate

@Maffooch Maffooch requested a review from mtesauro as a code owner November 5, 2025 18:47
Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Comment thread dojo/sla_config/helpers.py Outdated
Co-authored-by: valentijnscholten <valentijnscholten@gmail.com>
@dryrunsecurity
Copy link
Copy Markdown

dryrunsecurity Bot commented Nov 6, 2025

DryRun Security

This pull request introduces dynamic loading and execution of a method based on the FINDING_SLA_PERIOD_METHOD system setting, which allows an admin-updatable string to specify a function path that the application will import and call; if an attacker with administrative privileges can modify that setting they could cause arbitrary code execution on the server. This is a critical remote code execution risk stemming from executing user-configurable function paths.

Arbitrary Code Execution via Dynamic Method Loading in dojo/models.py
Vulnerability Arbitrary Code Execution via Dynamic Method Loading
Description The application dynamically loads and executes a method based on the FINDING_SLA_PERIOD_METHOD setting, which is stored in the System_Settings model. If an attacker with administrative privileges can modify this setting, they can specify a path to an arbitrary function (e.g., os.system or a custom malicious function) that will then be executed by the application, leading to arbitrary code execution on the server.

if method := get_custom_method("FINDING_SLA_PERIOD_METHOD"):
return method(self)


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

@Maffooch Maffooch merged commit 83834f0 into DefectDojo:bugfix Nov 7, 2025
150 checks passed
@Maffooch Maffooch deleted the sla-get-period branch November 7, 2025 05:32
Maffooch added a commit to valentijnscholten/django-DefectDojo that referenced this pull request Feb 16, 2026
…sk handlers (DefectDojo#13630)

* Add custom SLA calculation method to Finding model

* Refactor SLA expiration date update methods for async processing and improve system settings checks

* Update async SLA expiration date update to filter by product ID

* Update helpers.py

Co-authored-by: valentijnscholten <valentijnscholten@gmail.com>

---------

Co-authored-by: valentijnscholten <valentijnscholten@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants