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
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

dryrunsecurity bot commented Jan 17, 2026

DryRun Security

This pull request unpacks user-supplied request.data into background task dispatch calls (in dojo/api_v2/views.py), creating a mass-assignment vulnerability that lets attackers inject internal context fields like async_user or _pgh_context to impersonate users or spoof audit logs. The issue affects update_jira_epic and add_epic and should avoid passing raw request data into dojo_dispatch_task or ensure sensitive keys are filtered.

Mass Assignment: Unvalidated unpacking of `request.data` into background tasks in dojo/api_v2/views.py
Vulnerability Mass Assignment: Unvalidated unpacking of request.data into background tasks
Description The update_jira_epic and add_epic views in dojo/api_v2/views.py unpack the entire request.data dictionary into dojo_dispatch_task using the ** operator. This is a mass assignment vulnerability because dojo_dispatch_task and its helper _inject_async_user only inject internal context fields (like async_user and _pgh_context) if they are not already present in the arguments. Consequently, an attacker can provide these keys in the API request body to impersonate other users or spoof audit logs in the background tasks that are subsequently triggered.

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


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

@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.

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