AAK-IDE-TASK-003: VS Code launch.json preLaunchTask chains to a flagged auto-exec task
- Severity
- HIGH
- Category
- Hook Injection (
hook-injection) - Scanner
agent_audit_kit/scanners/ide_task_rce.py- Auto-fixable
- No.
- SARIF name
IdeLaunchPreLaunchTaskChain
What it detects
A configuration in .vscode/launch.json sets preLaunchTask to a task that AAK flagged (a folderOpen auto-run or a shell-reaching command). Starting a debug session then runs that task, so the launch config is a second trigger for the same code-execution path. Reported as one finding naming both files.
How to fix
Point preLaunchTask only at tasks that run vetted, fixed-argv commands. Remove the auto-run or shell injection from the referenced task (see the paired AAK-IDE-TASK-001 / AAK-IDE-TASK-002 finding).
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-IDE-TASK-003
Limitations
Matches a launch configuration's preLaunchTask by label against tasks that AAK-IDE-TASK-001 or AAK-IDE-TASK-002 flagged in the tasks.json next to it. A preLaunchTask that names a compound task (dependsOn: ["setup"]) reaches the same script but is not matched, and postDebugTask is not read. A tasks.json or launch.json over 1 MB is not read.
References
- OWASP Agentic Top 10: ASI05 (Unexpected Code Execution (RCE))
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-RCE-06
- CSA AI Controls Matrix (AICM): STA-08, IVS-04
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-IDE-TASK-003.md: the page then shows that text, with the registry reference appended under it.