🇰🇷 한글 설명
LangGraph Checkpoint 4.0.0 이전 버전에서 BaseCache의 기본 JsonPlusSerializer가 pickle_fallback=True로 설정되어 있어, msgpack 역직렬화 실패 시 pickle.loads()를 통한 원격 코드 실행 취약점이 발생합니다. 캐시 활성화, CachePolicy 설정, 그리고 캐시 백엔드 쓰기 권한 조건이 모두 충족될 때 공격 가능합니다.
💡 쉬운 설명
LangGraph의 캐시 시스템이 안전하지 않은 Python pickle 직렬화를 사용하여, 캐시에 접근 가능한 공격자가 악성 코드를 실행할 수 있습니다. 캐시 기능이 명시적으로 활성화되고 서버에 쓰기 권한이 있는 경우에만 공격이 가능합니다.
🇺🇸 원문 (English)
LangGraph Checkpoint defines the base interface for LangGraph checkpointers. Prior to version 4.0.0, a Remote Code Execution vulnerability exists in LangGraph's caching layer when applications enable cache backends that inherit from `BaseCache` and opt nodes into caching via `CachePolicy`. Prior to `langgraph-checkpoint` 4.0.0, `BaseCache` defaults to `JsonPlusSerializer(pickle_fallback=True)`. When msgpack serialization fails, cached values can be deserialized via `pickle.loads(...)`. Caching is not enabled by default. Applications are affected only when the application explicitly enables a cache backend (for example by passing `cache=...` to `StateGraph.compile(...)` or otherwise configuring a `BaseCache` implementation), one or more nodes opt into caching via `CachePolicy`, and the attacker can write to the cache backend (for example a network-accessible Redis instance with weak/no auth, shared cache infrastructure reachable by other tenants/services, or a writable SQLite cache file). An attacker must be able to write attacker-controlled bytes into the cache backend such that the LangGraph process later reads and deserializes them. This typically requires write access to a networked cache (for example a network-accessible Redis instance with weak/no auth or shared cache infrastructure reachable by other tenants/services) or write access to local cache storage (for example a writable SQLite cache file via permissive file permissions or a shared writable volume). Because exploitation requires write access to the cache storage layer, this is a post-compromise / post-access escalation vector. LangGraph Checkpoint 4.0.0 patches the issue.
📍 영향받는 시스템
langgraph-checkpoint < 4.0.0 (캐시 활성화 + CachePolicy 적용 시스템)
⚔️ 공격 벡터
네트워크 접근 가능한 Redis/캐시 또는 권한이 낮은 로컬 SQLite 캐시 파일에 악성 직렬화 바이트 작성
🛡️ 대응 방법
langgraph-checkpoint를 4.0.0 이상으로 업그레이드하고, 캐시 백엔드에 대한 접근 제어 강화
🔧 검증 코드
버전 번호가 4.0.0 이상이면 안전, 그 미만이면 취약합니다.
pip show langgraph-checkpoint 2>/dev/null | grep -i version || python3 -c "import langgraph_checkpoint; print(langgraph_checkpoint.__version__)" 2>/dev/null