🇰🇷 한글 설명
PostgreSQL Anonymizer의 column identifier에 악의적 코드를 삽입하여 superuser 권한으로 실행되는 특권 상승 취약점. PostgreSQL 14 및 이전 버전에서 업그레이드된 인스턴스에서 더 심각하며, k-anonymity 함수 호출 시 공격자의 코드가 superuser 권한으로 실행됨.
💡 쉬운 설명
PostgreSQL 데이터베이스의 일부 버전에서 일반 사용자가 관리자 권한을 얻을 수 있는 문제입니다. 테이블의 특정 부분에 숨겨진 명령어를 넣으면 관리자 권한으로 실행됩니다.
🇺🇸 원문 (English)
PostgreSQL Anonymizer contains a vulnerability that allows a user to gain superuser privileges by creating a table and placing malicious code inside a column identifier. If a superuser calls the k-anonymity function, the malicious code is executed with superuser privileges. The risk is higher with PostgreSQL 14 or with instances upgraded from PostgreSQL 14 or a prior version. With PostgreSQL 15 and later, the creation permission on the public schema is revoked by default and this exploit can only be achieved by a user who was explicitly granted the CREATE TABLE privilege. The problem is resolved in PostgreSQL Anonymizer 3.1.0 and further versions
📍 영향받는 시스템
PostgreSQL Anonymizer < 3.1.0 (특히 PostgreSQL 14 이하 또는 14에서 업그레이드된 인스턴스)
⚔️ 공격 벡터
비정상 column identifier에 SQL 명령어 주입 후 superuser가 k-anonymity 함수 호출 시 악성 코드 실행
🛡️ 대응 방법
PostgreSQL Anonymizer를 3.1.0 이상으로 업그레이드하고, PostgreSQL 15 이상 사용 권장
🔧 검증 코드
PostgreSQL Anonymizer 버전 확인 시 3.1.0 이상이면 안전, 미만이면 업그레이드 필요. extension이 없으면 취약점 영향 없음.
psql -U postgres -c "SELECT version FROM pg_extension WHERE extname='anon'" 2>/dev/null || echo 'extension not found'