Celery 5.6
Last reviewed Sep 12, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- Celery 5.655 lines · 1.3K tokens
Total210 lines · 5.1K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 78
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 306
- 319
- 328
- 338
- 347
- 367
- 379
- 409
- 416
- 426
- 427
- 459
- 470
- 502
- 532
- 611
- 639
- 674
- 732
- 770
- 772
- 776
- 807
- 829
- 862
- 916
- 918
- 1104
- 1333
- 1395
Prompt Preview
Apply the Python 3 baseline first. These rules cover Celery 5.6 message trust, task authorization, broker and result transport, worker isolation, retries, and operational controls.
Message formats and trust
- Keep
accept_content={'json'}or a narrower non-executable allowlist, and setresult_accept_contentexplicitly; its defaultNoneinheritsaccept_content. - Do not enable pickle, YAML object construction, or other executable serializers for messages from an untrusted producer.
- Validate every task argument against a task-specific schema before using it.
- Keep task names fixed at registration time and never dispatch an attacker-selected dotted Python path.
- Bound argument size, collection length, and nesting before task execution, and bound decoded result size at the consuming boundary.
Task authorization and data
- Authorize the initiating identity before enqueueing a task and include only the minimum immutable authorization context required.
- Reauthorize sensitive resources inside the task when privileges or ownership may change before execution.
- Pass opaque identifiers rather than credentials, full request objects, or sensitive model snapshots in messages.
- Derive tenant scope on the worker from trusted context and never from an unverified task argument alone.
- Keep privileged maintenance tasks on separate queues with distinct producers, routing rules, and worker identities.
- Authorize result retrieval and task revocation against trusted task ownership;
AsyncResult(task_id)does not enforce caller or tenant access.