🇰🇷 한글 설명
pg_partman 5.5.0 미만 버전에서 undo_partition() 함수가 part_config.time_encoder 값을 적절한 식별자 인용 없이 동적 SQL에 삽입하여 발생하는 취약점입니다. partman_user 권한을 가진 사용자가 악성 SQL을 삽입할 수 있으며, 이 함수를 호출하는 권한 있는 사용자의 권한으로 해당 SQL이 실행됩니다.
💡 쉬운 설명
데이터베이스 관리 도구의 설정값에 악성 명령어를 숨겨서 실행할 수 있는 보안 약점입니다. 권한이 있는 사용자가 의도치 않게 관리자 권한으로 잘못된 명령을 수행하게 만들어 데이터를 조작하거나 유출할 수 있습니다.
🇺🇸 원문 (English)
pg_partman is a PostgreSQL extension that manages partitioned tables by time or ID. Prior to 5.5.0, undo_partition() reads part_config.time_encoder as unrestricted text and interpolates it without identifier quoting into a dynamically executed SELECT statement. A role with partman_user access can store SQL rather than a function name, and the SQL executes with the privileges of the caller that invokes undo_partition(). The function is not part of the default background-worker path, which limits the automatic superuser escalation described by the related create-partition vulnerability, but a privileged caller can still have its available confidentiality, integrity, and availability permissions abused. This issue is fixed in version 5.5.0.
📍 영향받는 시스템
pg_partman version < 5.5.0
⚔️ 공격 벡터
partman_user 권한을 이용해 part_config.time_encoder에 악성 SQL을 삽입한 후, 권한이 높은 사용자가 undo_partition()을 호출하도록 유도
🛡️ 대응 방법
pg_partman을 5.5.0 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 5.5.0 미만이면 취약한 상태입니다.
psql -c "SELECT extversion FROM pg_extension WHERE extname = 'pg_partman';"