🇰🇷 한글 설명
Langroid 프레임워크의 SQLChatAgent에서 프롬프트 인젝션을 통해 LLM이 생성한 SQL을 조작할 수 있는 취약점이 발견되었습니다. 데이터베이스 권한이 높게 설정된 경우, 공격자가 악성 SQL 명령어를 실행하여 데이터베이스 호스트에서 원격 코드 실행(RCE)을 달성할 수 있습니다.
💡 쉬운 설명
AI가 데이터베이스에 명령을 내릴 때, 나쁜 의도를 가진 사용자가 명령어를 몰래 끼워 넣어 컴퓨터를 마음대로 조종할 수 있는 문제입니다. AI가 데이터베이스의 관리자 권한을 가지고 있을 때 특히 위험합니다.
🇺🇸 원문 (English)
Langroid is a framework for building large-language-model-powered applications. Prior to version 0.63.0, SQLChatAgent executes SQL produced by an LLM, which is influenceable by prompt injection. When configured with a database role that has privileges enabling code execution or filesystem access (e.g., PostgreSQL pg_execute_server_program, MySQL FILE, MSSQL xp_cmdshell), an attacker who can shape the agent's input — including indirectly via data returned to the LLM — can coerce execution of dialect-specific primitives such as `COPY ... FROM PROGRAM`, achieving RCE on the database host. Fixed in v0.63.0 by defaulting SQLChatAgent to a SELECT-only sqlglot-parsed statement allowlist with a dialect-aware dangerous-pattern blocklist; allow_dangerous_operations=True restores the previous unrestricted behavior for trusted deployments.
📍 영향받는 시스템
Langroid framework versions prior to 0.63.0
⚔️ 공격 벡터
프롬프트 인젝션을 통해 LLM이 생성하는 SQL 문에 악성 구문(예: COPY FROM PROGRAM)을 삽입하여 실행
🛡️ 대응 방법
Langroid를 v0.63.0 이상으로 업데이트하거나, SQLChatAgent 설정 시 allow_dangerous_operations를 False(기본값)로 유지하십시오.
🔧 검증 코드
출력된 버전이 0.63.0 미만이면 취약한 상태이며, 0.63.0 이상이면 안전합니다.
pip show langroid | grep Version