🇰🇷 한글 설명
Langroid 프레임워크의 SQLChatAgent에서 SQL 인젝션 방어 기제가 우회될 수 있는 취약점이 발견되었습니다. 기존의 정규식 기반 차단 방식이 PostgreSQL의 특정 구문(따옴표, 주석, 스키마 지정 등)을 제대로 필터링하지 못해 서버 측 파일 읽기 권한이 노출될 수 있습니다.
💡 쉬운 설명
데이터베이스를 보호하기 위해 만든 필터링 규칙을 교묘하게 피해가는 공격 방법이 발견되었습니다. 이를 통해 공격자가 서버에 저장된 중요한 파일을 몰래 읽어갈 위험이 있습니다.
🇺🇸 원문 (English)
Langroid is a framework for building large-language-model-powered applications. Prior to version 0.65.1, the `SQLChatAgent` SQL-injection mitigation, with default `allow_dangerous_operations=False`, combines a raw-text regex blocklist (`_DANGEROUS_SQL_PATTERNS`) with a `sqlglot` SELECT-only statement allowlist. The blocklist entries that target callable functions require the function name to be immediately followed by `\s*\(`. PostgreSQL accepts the same call with the name separated from `(` by a quoted identifier, an inline comment, or schema qualification. These forms evade the regex, still parse as `SELECT`, and execute the same PostgreSQL function. This restores the `pg_read_file` server-side file-read primitive that the prior CVE-2026-25879 / GHSA-pmch-g965-grmr fix was meant to block: the parent advisory fixed a missing `pg_read_file` blocklist entry, while this report shows that the added regex is bypassable. Version 0.65.1 fixes the issue.
📍 영향받는 시스템
Langroid framework versions prior to 0.65.1
⚔️ 공격 벡터
PostgreSQL의 특수 구문을 활용하여 정규식 기반의 SQL 함수 차단 규칙을 우회하는 SQL 인젝션 공격
🛡️ 대응 방법
Langroid 프레임워크를 버전 0.65.1 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전이 0.65.1보다 낮으면 취약한 상태이며, 0.65.1 이상이면 안전합니다.
pip show langroid | grep Version
💻 영향받는 소프트웨어
IBM WebSphere Application Server