🇰🇷 한글 설명
PostgreSQL Anonymizer 확장에서 공개 스키마에 악의적인 커스텀 연산자를 생성하여 슈퍼유저 권한으로 실행할 수 있는 권한 상승 취약점입니다. PostgreSQL 14 이하 버전에서 특히 위험하며, 버전 3.0.1 이상에서 해결되었습니다.
💡 쉬운 설명
PostgreSQL의 Anonymizer 확장 프로그램에서 악의적인 사용자가 데이터베이스 관리자(슈퍼유저) 권한을 탈취할 수 있는 보안 결함이 있습니다. 이를 통해 전체 데이터베이스에 대한 최상위 접근권을 획득할 수 있어 매우 위험합니다.
🇺🇸 원문 (English)
PostgreSQL Anonymizer contains a vulnerability that allows a user to gain superuser privileges by creating a custom operator in the public schema and place malicious code in that operator. This operator will later be executed with superuser privileges when the extension is created. 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 if a superuser adds a new schema in her/his own search_path and grants the CREATE privilege on that schema to untrusted users, both actions being clearly discouraged by the PostgreSQL documentation. The problem is resolved in PostgreSQL Anonymizer 3.0.1 and further versions
📍 영향받는 시스템
PostgreSQL Anonymizer 3.0.0 이하 버전 (PostgreSQL 14 이하에서 높은 위험도)
⚔️ 공격 벡터
Public schema에 악성 코드가 포함된 커스텀 연산자를 생성하고 extension 로드 시 superuser 권한으로 실행
🛡️ 대응 방법
PostgreSQL Anonymizer를 3.0.1 이상으로 즉시 업그레이드하거나 PostgreSQL 15 이상으로 업그레이드
🔧 검증 코드
설치된 PostgreSQL Anonymizer의 버전을 확인하여 3.0.1 이상이면 안전하고, 그 이하이거나 설치되지 않았으면 업그레이드 필요
pip show postgresql-anonymizer 2>/dev/null | grep -i version || dpkg -l 2>/dev/null | grep -i anonymizer