Skip to content

AAK-LANGCHAIN-002: Call to load_prompt without allow_dangerous_paths review

Severity
MEDIUM
Category
Taint Analysis (taint-analysis)
Scanner
agent_audit_kit/scanners/langchain_vuln.py
Auto-fixable
No.
SARIF name
LangchainLoadPromptUserPath

What it detects

Source code calls langchain.load_prompt() or load_prompt_from_config() with a user-controlled path argument. Even on patched versions, the allow_dangerous_paths escape hatch is a sharp edge.

How to fix

Treat load_prompt() as a file read against a trusted root. Resolve, normalize, and verify the path is inside the intended directory.

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

agent-audit-kit scan . --rules AAK-LANGCHAIN-002

Limitations

Pattern-matches the first load_prompt( or load_prompt_from_config( call in a file that mentions langchain, and only when the argument is a bare (dotted) name or an f-string with a {} placeholder. An argument that is a call (os.path.join(PROMPTS, name)), a concatenation ("prompts/" + name) or a keyword (path=name) is not matched. A requirements file or pyproject.toml over 2 MB is not read. A pyproject.toml with a key of more than 64 dotted parts, or holding an integer Python cannot convert (one past 4,300 digits), is refused and reported as AAK-INTERNAL-SCANNER-FAIL.

References

  • CVE: CVE-2026-34070
  • OWASP Agentic Top 10: ASI02 (Tool Misuse and Exploitation), ASI04 (Agentic Supply Chain Vulnerabilities)
  • Adversa AI MCP Top 25 (AAK-defined ids): ADV-SUPPLY-02 (Unpinned Package)

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-LANGCHAIN-002.md: the page then shows that text, with the registry reference appended under it.