🇰🇷 한글 설명
LangChain MongoDB 통합 라이브러리에서 필터 딕셔너리를 처리할 때 '$'로 시작하는 키를 재귀적으로 거부하지 않는 취약점이 발견되었습니다. 인증된 공격자가 필터 인자를 조작하여 MongoDB 쿼리 연산자를 주입할 수 있으며, 이를 통해 멀티테넌트 환경에서 타 사용자의 데이터를 열람할 수 있습니다.
💡 쉬운 설명
데이터를 검색할 때 사용하는 필터에 특수 명령어를 몰래 끼워 넣어 보안 규칙을 무력화할 수 있는 문제입니다. 이를 통해 원래는 볼 수 없는 다른 사용자의 정보가 유출될 위험이 있습니다.
🇺🇸 원문 (English)
LangChain MongoDB provides integrations between MongoDB, Atlas, LangChain, and LangGraph. Prior to langgraph-checkpoint-mongodb 0.3.0 and langgraph-store-mongodb 0.4.0, MongoDBSaver.list(), MongoDBSaver.alist(), and MongoDBStore.search() incorporate filter dictionaries into MongoDB queries without recursively rejecting keys prefixed with $. An authenticated caller who controls a filter argument through HTTP query parameters, request body fields, or agent tool arguments can inject MongoDB Query Language operators such as $regex or $where. In a multi-tenant deployment that uses the filter to enforce per-user or per-tenant isolation, injected operators can bypass intended equality filtering and expose other tenants' checkpoint or store data. Filters constructed entirely from trusted server-side values have lower practical risk. This issue is fixed in langgraph-checkpoint-mongodb 0.3.0 and langgraph-store-mongodb 0.4.0.
📍 영향받는 시스템
langgraph-checkpoint-mongodb < 0.3.0, langgraph-store-mongodb < 0.4.0
⚔️ 공격 벡터
HTTP 쿼리 파라미터, 요청 본문 또는 에이전트 도구 인자를 통해 MongoDB 쿼리 연산자($regex, $where 등) 주입
🛡️ 대응 방법
langgraph-checkpoint-mongodb 0.3.0 또는 langgraph-store-mongodb 0.4.0 이상 버전으로 업데이트
🔧 검증 코드
출력된 버전이 langgraph-checkpoint-mongodb 0.3.0 미만 또는 langgraph-store-mongodb 0.4.0 미만인지 확인
pip list | grep -E 'langgraph-checkpoint-mongodb|langgraph-store-mongodb'