🔍 CVE-2026-58225

0.0
CVSS Score
UNKNOWN
2026-07-10
2026-10-24 23:10
✅ 완료

🇰🇷 한글 설명

elixir-ecto의 postgrex 라이브러리에서 LISTEN 채널 이름에 달러 인용 부호($$)를 포함할 경우 발생하는 SQL 인젝션 취약점입니다. 공격자가 채널 이름을 조작하여 재연결 시 실행되는 쿼리를 손상시키면, 알림 연결이 끊어지고 서비스 거부(DoS) 상태가 발생할 수 있습니다.

💡 쉬운 설명

채널 이름에 특수 기호를 넣어 데이터베이스 명령어를 꼬이게 만드는 공격입니다. 이 공격을 받으면 알림 기능이 작동하지 않아 시스템이 정상적으로 정보를 주고받을 수 없게 됩니다.

🇺🇸 원문 (English)

SQL Injection vulnerability in elixir-ecto postgrex allows an attacker who can influence a LISTEN channel name to inject SQL into the reconnect replay query, causing a denial of service of the notification connection. Postgrex.Notifications sanitizes channel names with quote_channel/1, which doubles double quotes so the name is safe inside a double-quoted identifier. This protects the single-statement LISTEN and UNLISTEN paths. On every (re)connect, however, handle_connect/1 replays all registered channels at once by concatenating their LISTEN statements and wrapping them in a dollar-quoted anonymous code block (DO $$BEGIN ... END$$). quote_channel/1 does not escape the $$ dollar-quote delimiter that opens and closes this block. The listen/3 guards only reject null bytes and names longer than 63 bytes, so a channel name containing $$ passes validation unchanged. Once such a name is embedded, its $$ prematurely terminates the outer dollar-quoted string and PostgreSQL parses the remainder as additional top-level statements. Because handle_connect/1 runs on every (re)connect, the malformed replay query is rejected each time and the notification connection never re-establishes its subscriptions, silently dropping notifications for every channel sharing that connection. An application is affected when it passes untrusted input (for example a tenant or user identifier) as a channel name to Postgrex.Notifications.listen/3. The double-quote doubling prevents forming a fully valid injected statement, so arbitrary SQL execution is not possible, but the corrupted query reliably breaks the shared notification connection for all tenants, resulting in denial of service. This issue affects postgrex: from 0.16.0 before 0.22.3.

📍 영향받는 시스템

postgrex: 0.16.0 ~ 0.22.2

⚔️ 공격 벡터

사용자 입력값이 포함된 채널 이름을 Postgrex.Notifications.listen/3 함수에 전달하여 SQL 쿼리 구조를 파괴함

🛡️ 대응 방법

postgrex 라이브러리를 0.22.3 버전 이상으로 업데이트하십시오.

🔧 검증 코드

출력된 postgrex의 버전이 0.22.3 미만인지 확인하십시오.

Shell / Script
mix exec 'mix list deps | grep postgrex'

💻 영향받는 소프트웨어

PostgreSQL