Skip to content

Conversation

@valentijnscholten
Copy link
Member

@valentijnscholten valentijnscholten commented Dec 26, 2025

The custom decorators that we have on Celery tasks interfere with some (advanced) celery functionality like signatures. This PR refactors this to have a clean base task that passes on context, but does not interfere with celery mechanisms.

The logic to decide whether or not the task is to be called asyncrhonously is now in a dispatch method.

Pro needs similar changes via https://github.com/DefectDojo-Inc/dojo-pro/pull/973, these must be merged "at the same time".

@valentijnscholten valentijnscholten added this to the 2.55.0 milestone Dec 26, 2025
@github-actions github-actions bot added settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR apiv2 unittests ui parser labels Dec 26, 2025
@valentijnscholten valentijnscholten added the affects_pro PRs that affect Pro and need a coordinated release/merge moment. label Dec 27, 2025
@valentijnscholten valentijnscholten changed the title remove dojo async task base task refactor dojo async task base task Dec 28, 2025
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@valentijnscholten valentijnscholten force-pushed the remove-dojo-async-task-base-task branch from 31a5314 to 917aa72 Compare January 5, 2026 19:17
@valentijnscholten valentijnscholten marked this pull request as draft January 7, 2026 21:23
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Resolved conflicts:
- dojo/utils.py: Added grade_product function from upstream, kept removal of @dojo_async_task decorator
- unittests/test_importers_performance.py: Updated expected query count to 319 (from upstream)
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@valentijnscholten
Copy link
Member Author

I have had to include the commits from #14090 in this PR to make sure the downstream Pro codebase still works.

@valentijnscholten
Copy link
Member Author

i've also had to include the commits from #14109 to make the downstream Pro codebase work.

@valentijnscholten
Copy link
Member Author

And then I had to include the commits from #14080 to fix other errors in Pro.

@valentijnscholten valentijnscholten marked this pull request as ready for review January 17, 2026 15:51
@dryrunsecurity
Copy link

DryRun Security

🟡 Please give this pull request extra attention during review.

This pull request introduces a risky SSRF vulnerability: the update_jira_epic view forwards user-controlled request.data directly into dojo_dispatch_task (which calls jira_helper functions that make HTTP requests to JIRA) without validating or allowlisting URL/host values, allowing an attacker to cause the server to make requests to arbitrary or internal hosts.

🟡 Potential Server-Side Request Forgery (SSRF) in dojo/api_v2/views.py
Vulnerability Potential Server-Side Request Forgery (SSRF)
Description The view update_jira_epic dispatches jira_helper.update_epic / add_epic with **request.data passed directly into dojo_dispatch_task. The dispatch implementation (in the provided patch) injects user context and either executes the Celery signature async or runs it synchronously, but it does not validate or allowlist any URL/hostname values that may be inside request.data. The jira helper functions ultimately perform HTTP requests to JIRA (push/update/add epics). Since request.data is user-controlled and forwarded into the task kwargs without sanitization, an attacker could include malicious URL/host fields (or other parameters used by the Jira helper) that cause the server to make requests to arbitrary/internal hosts, meeting SSRF criteria.

try:
if engagement.has_jira_issue:
dojo_dispatch_task(jira_helper.update_epic, engagement.id, **request.data)
response = Response(
{"info": "Jira Epic update query sent"},
status=status.HTTP_200_OK,
)
else:
dojo_dispatch_task(jira_helper.add_epic, engagement.id, **request.data)
response = Response(
{"info": "Jira Epic create query sent"},
status=status.HTTP_200_OK,


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects_pro PRs that affect Pro and need a coordinated release/merge moment. apiv2 parser ui unittests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants