AAK-LANGCHAIN-003: LangChain deserialization of untrusted data
- Severity
- HIGH
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/langchain_vuln.py- Auto-fixable
- Yes.
agent-audit-kit fixcan apply it. - SARIF name
LangchainDeserializeUntrusted
What it detects
A Python manifest pins langchain-core below 0.3.14. CVE-2025-68664 (GHSA-c67j-w6g6-q2cm) is a serialization-injection chain in langchain-core's dumps/loads that extracts secrets through crafted saved chains.
How to fix
Upgrade langchain-core to 0.3.81 or later on the 0.3 line, or to 1.2.5 or later on 1.x, and pin it. Avoid loading serialized chains from sources you do not fully control.
agent-audit-kit fix can apply this change for you; add --dry-run to preview it.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-LANGCHAIN-003
Limitations
Reads langchain-core from the same Python manifests as AAK-LANGCHAIN-001, never npm. The floor is the rule's original 0.3.14, below the advisory's fixes, which are 0.3.81 on 0.3 and 1.2.5 on 1.x, so langchain-core 0.3.14 to 0.3.80 and 1.0.0 to 1.2.4 are affected and not reported. Every version below 0.3.14 is also below AAK-LANGCHAIN-001's 1.2.22, which does report it. LangChain.js has a separate advisory, which no rule cites. 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-2025-68664
- OWASP Agentic Top 10: ASI04 (Agentic Supply Chain Vulnerabilities), ASI05 (Unexpected Code Execution (RCE))
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-SUPPLY-03 (Unpinned MCP 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-003.md: the page then shows that text, with the registry reference appended under it.