AAK-TAINT-008: Tool function with excessive dangerous sinks
- Severity
- MEDIUM
- Category
- Taint Analysis (
taint-analysis) - Scanner
agent_audit_kit/scanners/taint_analysis.py- Auto-fixable
- No.
- SARIF name
TaintExcessiveSinks
What it detects
A @tool function calls sinks of three or more of the categories behind AAK-TAINT-001 to -006 (shell, eval/exec, file access, HTTP, SQL, unsafe deserialization), whether or not a parameter reaches them, which indicates overly broad permissions. A pathlib.Path read only for a part of its name (Path(p).name) opens nothing and does not count as file access, so a tool calling subprocess.run, requests.post and Path(p).name reaches two.
How to fix
Split the tool so that each function reaches at most two of the sink categories behind AAK-TAINT-001 to AAK-TAINT-006 (shell, eval/exec, file access, HTTP, SQL, unsafe deserialization). The rule fires at three.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-TAINT-008
Limitations
Only functions decorated @tool, @mcp.tool, @server.tool, @langchain.tools.tool, @crewai.tool or @autogen.tool are analysed, so a FastMCP instance under another name (@app.tool()) is skipped. Sink categories are counted only for calls made in the body of the decorated function, so a tool that reaches a shell, a file and the network through module-level helper functions it calls is not reported.
References
- OWASP MCP Top 10: MCP02:2025 (Privilege Escalation via Scope Creep)
- OWASP Agentic Top 10: ASI02 (Tool Misuse and Exploitation)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-SCOPE-05 (Excessive Dangerous Sinks)
- CSA AI Controls Matrix (AICM): AIS-07
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-TAINT-008.md: the page then shows that text, with the registry reference appended under it.