🇰🇷 한글 설명
PostgreSQL의 멀티바이트 문자 인코딩(SJIS, BIG5, GBK 등)에서 백슬래시(\)가 문자의 끝바이트로 사용될 때 SQL 주입 보호를 우회하는 취약점입니다. 클라이언트가 멀티바이트 인코딩을 올바르게 처리하지 못하면 공격 가능합니다.
💡 쉬운 설명
PostgreSQL이 특정 언어의 글자(한글, 중국어, 일본어 등)를 처리할 때 보안 검사를 무시하는 문제입니다. 공격자가 이를 이용해 데이터베이스에 몰래 명령을 삽입할 수 있습니다.
🇺🇸 원문 (English)
PostgreSQL 8.1.x before 8.1.4, 8.0.x before 8.0.8, 7.4.x before 7.4.13, 7.3.x before 7.3.15, and earlier versions allows context-dependent attackers to bypass SQL injection protection methods in applications that use multibyte encodings that allow the "\" (backslash) byte 0x5c to be the trailing byte of a multibyte character, such as SJIS, BIG5, GBK, GB18030, and UHC, which cannot be handled correctly by a client that does not understand multibyte encodings, aka a second variant of "Encoding-Based SQL Injection." NOTE: it could be argued that this is a class of issue related to interaction errors between the client and PostgreSQL, but a CVE has been assigned since PostgreSQL is treating this as a preventative measure against this class of problem.
📍 영향받는 시스템
PostgreSQL 8.1.x(8.1.4 미만), 8.0.x(8.0.8 미만), 7.4.x(7.4.13 미만), 7.3.x(7.3.15 미만)
⚔️ 공격 벡터
멀티바이트 인코딩된 입력값에서 백슬래시를 이용해 SQL 필터링 우회 후 악의적 쿼리 실행
🛡️ 대응 방법
영향받는 버전을 각각 8.1.4, 8.0.8, 7.4.13, 7.3.15 이상으로 업그레이드
🔧 검증 코드
출력된 버전이 안전 버전(8.1.4, 8.0.8, 7.4.13, 7.3.15 이상) 이상인지 확인
psql -U postgres -c "SELECT version();" | grep -oP 'PostgreSQL \K[\d.]+' || echo 'PostgreSQL not installed'