🇰🇷 한글 설명
LangChain4j 라이브러리의 MariaDB 및 pgvector 임베딩 저장소에서 메타데이터 필터 SQL 생성 시 적절한 이스케이프 처리 없이 문자열을 결합하는 취약점이 발견되었습니다. 공격자가 조작된 메타데이터 키를 사용하여 SQL 인젝션을 수행할 수 있으며, 이를 통해 데이터를 유출하거나 서비스를 거부하거나 임의의 행을 삭제할 수 있습니다.
💡 쉬운 설명
AI 앱을 만들 때 사용하는 도구에서 데이터베이스 명령어를 잘못 처리하는 보안 구멍이 발견되었습니다. 나쁜 의도를 가진 사용자가 특수한 명령어를 입력하면 데이터베이스의 정보를 몰래 빼가거나 데이터를 지울 수 있습니다.
🇺🇸 원문 (English)
LangChain4j is a Java library for building LLM-powered applications on the JVM. Prior to 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26, the MariaDB and pgvector embedding stores build metadata-filter SQL by string-concatenating filter keys, and in MariaDB string values, directly into the query without adequate escaping. A crafted metadata key in EmbeddingSearchRequest.filter() can break out of its SQL context and inject arbitrary SQL into the statements executed by the stores' search and removeAll(Filter) operations, enabling blind data exfiltration, denial of service via sleep functions, and deletion of arbitrary rows through removeAll(Filter). This issue is fixed in langchain4j-mariadb and langchain4j-pgvector versions 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26.
📍 영향받는 시스템
LangChain4j (MariaDB 및 pgvector 저장소 사용 시) 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, 1.16.3-beta26 미만 버전
⚔️ 공격 벡터
EmbeddingSearchRequest.filter() 메서드에 조작된 메타데이터 키를 전달하여 SQL 인젝션 수행
🛡️ 대응 방법
langchain4j-mariadb 및 langchain4j-pgvector를 최신 수정 버전(1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, 1.16.3-beta26 이상)으로 업데이트
🔧 검증 코드
출력된 라이브러리 버전이 취약점이 해결된 버전(1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, 1.16.3-beta26 이상)인지 확인합니다.
mvn dependency:list | grep -E 'langchain4j-mariadb|langchain4j-pgvector'