{"answers":{"affected":"5 open source packages ship an affected version, including langchain-core.","exploited":"There is no known exploitation of CVE-2025-65106 in the wild and no public exploit code.","fix":"Upgrade langchain-core to a fixed version for your release line: 0.3.80 or 1.0.7.","what":"CVE-2025-65106 is a high-severity code injection vulnerability in langchain-ai langchain, published on 21 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2025-65106 and fix it if it is affected.\n\nWhat it is: CVE-2025-65106 is a high-severity code injection vulnerability in langchain-ai langchain, published on 21 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2025-65106 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- langchain-core (PyPI): affected all versions; fixed in 0.3.80, 1.0.7\n- langchain-core (PyPI): affected all versions; fixed in 0.3.80\n- langchain-core (PyPI): affected all versions; fixed in 0.3.80\n- langchain-core (PyPI): affected from 1.0.0; fixed in 1.0.7\n- langchain-core (PyPI): affected from 1.0.0; fixed in 1.0.7\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2025-65106/ (Markdown: https://insights.sbomify.com/CVE-2025-65106/index.md)","id":"CVE-2025-65106","markdown":"https://insights.sbomify.com/CVE-2025-65106/index.md","name":"CVE-2025-65106","record":{"aliases":["ECHO-159f-63a0-e634","GHSA-6qv9-48xg-fc7f","PYSEC-2026-1518","ROOT-APP-PYPI-CVE-2025-65106"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"LangChain Python library","requires_auth":"none","summary":"Attackers can execute arbitrary code by injecting malicious template syntax into LangChain prompt templates that accept untrusted input.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":8.3,"severity":"high","source":"cna","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N","version":"4.0"},"cwes":[{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine"}],"description":"LangChain is a framework for building agents and LLM-powered applications. From versions 0.3.79 and prior and 1.0.0 to 1.0.6, a template injection vulnerability exists in LangChain's prompt template system that allows attackers to access Python object internals through template syntax. This vulnerability affects applications that accept untrusted template strings (not just template variables) in ChatPromptTemplate and related prompt template classes. This issue has been patched in versions 0.3.80 and 1.0.7.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"LangChain Vulnerable to Template Injection via Attribute Access in Prompt Templates","id":"CVE-2025-65106","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2025"},"n_packages":5,"n_references":3,"next":{"headline":"Langfuse SSO Account Takeover via CSRF or phishing attack","id":"CVE-2025-65107"},"packages":[{"ecosystem":"PyPI","fixed":["0.3.80","1.0.7"],"introduced":["0","1.0.0"],"last_affected":[],"package":"langchain-core","purl":"pkg:pypi/langchain-core","source":"PYSEC-2026-1518"},{"ecosystem":"PyPI","fixed":["0.3.80"],"introduced":["0"],"last_affected":[],"package":"langchain-core","purl":null,"source":"GHSA-6qv9-48xg-fc7f"},{"ecosystem":"PyPI","fixed":["0.3.80"],"introduced":["0"],"last_affected":[],"package":"langchain-core","purl":"pkg:pypi/langchain-core","source":"GHSA-6qv9-48xg-fc7f"},{"ecosystem":"PyPI","fixed":["1.0.7"],"introduced":["1.0.0"],"last_affected":[],"package":"langchain-core","purl":null,"source":"GHSA-6qv9-48xg-fc7f"},{"ecosystem":"PyPI","fixed":["1.0.7"],"introduced":["1.0.0"],"last_affected":[],"package":"langchain-core","purl":"pkg:pypi/langchain-core","source":"GHSA-6qv9-48xg-fc7f"}],"prev":{"headline":"Apptainer ineffective application of selinux and apparmor --security options","id":"CVE-2025-65105"},"products":["langchain"],"published":"2025-11-21","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-11-21","vendors":["langchain-ai"]},"summary":"Attackers can execute arbitrary code by injecting malicious template syntax into LangChain prompt templates that accept untrusted input.","url":"https://insights.sbomify.com/CVE-2025-65106/"}