Skip to content

AAK-TASKS-004: MCP Tasks creation has no quota / concurrency bound (task-flood DoS)

Severity
MEDIUM
Category
MCP Configuration (mcp-config)
Scanner
agent_audit_kit/scanners/mcp_tasks.py
Auto-fixable
No.
SARIF name
TasksNoQuota

What it detects

The MCP Tasks primitive (SEP-2663) exposes a task-creation path (tasks/create, create_task, enqueue, submit) with no per-caller quota, max-in-flight, or concurrency bound. Unbounded task creation lets a caller flood the server with long-running tasks and exhaust memory / worker capacity — a task-flood denial of service. This is distinct from a missing TTL / cancellation path (AAK-TASKS-003): a server may expire and cancel tasks yet still accept unlimited concurrent creation.

How to fix

Bound task creation: a per-caller quota and a max-in-flight / concurrency cap (e.g. a bounded semaphore or a queue depth limit), and reject or back-pressure creation once the bound is reached.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-TASKS-004

Limitations

Fires when a file with a task class has a creation path (tasks/create; a def named create_task, add_task, spawn_task, start_task, enqueue* or submit*; or a call to create_task(, enqueueTask(, submitTask( or addTask() and none of max_tasks, maxTasks, task_limit, quota, max_concurren*, concurrency_limit, max_in_flight, max_pending, rate_limit*, ratelimit, backpressure, Semaphore or BoundedSemaphore, in any case, with _ or - between words optional (maxInFlight, max-tasks). createTask( is not recognised as a creation path, and a quota word in a comment counts as a bound.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-TASKS-004.md: the page then shows that text, with the registry reference appended under it.