🇰🇷 한글 설명
LangChain의 프롬프트 템플릿 시스템에서 템플릿 인젝션 취약점이 발견되어, 신뢰할 수 없는 템플릿 문자열을 입력받는 애플리케이션의 경우 공격자가 Python 객체 내부에 접근할 수 있습니다. ChatPromptTemplate 및 관련 클래스를 통해 공격이 가능하며, 0.3.80과 1.0.7 버전에서 패치되었습니다.
💡 쉬운 설명
LangChain의 템플릿 기능이 악의적인 사용자의 특수한 명령어를 처리할 때 Python의 숨겨진 정보에 접근을 허용합니다. 공격자는 이를 통해 시스템의 민감한 정보를 탈취할 수 있습니다.
🇺🇸 원문 (English)
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.
📍 영향받는 시스템
LangChain 0.3.79 이하 및 1.0.0~1.0.6 버전
⚔️ 공격 벡터
신뢰할 수 없는 프롬프트 템플릿 문자열을 ChatPromptTemplate에 전달하여 템플릿 인젝션 공격 수행
🛡️ 대응 방법
LangChain을 0.3.80 또는 1.0.7 이상 버전으로 업그레이드
🔧 검증 코드
버전이 0.3.80 이상 또는 1.0.7 이상이면 패치됨; 그 이하면 취약함
pip show langchain | grep Version | awk '{print $NF}' | grep -E '^(0\.(3\.80|4|[4-9])|1\.[1-9]|[2-9])'