Skip to content

Validate the Jira epic action body and reject reserved dispatch kwargs - #15782

Open
svader0 wants to merge 1 commit into
DefectDojo:bugfixfrom
svader0:harden-epic-dispatch-kwargs
Open

Validate the Jira epic action body and reject reserved dispatch kwargs#15782
svader0 wants to merge 1 commit into
DefectDojo:bugfixfrom
svader0:harden-epic-dispatch-kwargs

Conversation

@svader0

@svader0 svader0 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

POST /api/v2/engagements/{id}/update_jira_epic/ passed the whole request body into the Celery
dispatcher as keyword arguments. The action's schema already advertises
EngagementUpdateJiraEpicSerializer, but the code never instantiated it. Two results: any key a
client sent became a dispatcher keyword, and a body that was not a JSON object raised an unhandled
500.

This change uses that serializer, so only epic_name and epic_priority reach the dispatcher, and
a non-object body returns 400.

dojo_dispatch_task now also rejects async_user_id and _pgh_context when a caller supplies
them. The dispatcher injects both itself, and no call site in the codebase passes either one, so
this just makes the contract explicit.

Behaviour changes

All of these are the declared schema being enforced. Nothing in the codebase sends any of them.

  • force_sync, force_async, countdown and ignore_result stop affecting this action.
  • An empty epic_name, or one over 200 characters, now returns 400.
  • epic_priority: null still passes through. Both tasks already handle None.

Tests

Three regression tests in the existing unittests/test_permissions_audit.py::TestJiraEpicBFLA. Each
one fails without this change.

update_jira_epic passed the whole request body into dojo_dispatch_task as
keyword arguments. The action already advertised EngagementUpdateJiraEpicSerializer
in its schema but never instantiated it, so any key a client sent became a
dispatcher keyword and a non-object body raised an unhandled 500.

dojo_dispatch_task now also refuses async_user_id and _pgh_context from a
caller. The dispatcher injects both itself and no call site supplies them, so
this stops a future call site forwarding untrusted keys into the same channel.

force_sync, force_async, countdown and ignore_result stop affecting this action.
None was in its declared schema and no caller sends them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant