🇰🇷 한글 설명
pgAdmin 4 서버 모드에서 비밀번호 파일, 클라이언트 인증서 또는 키가 설정되지 않았거나 찾을 수 없을 때, 연결 설정에서 해당 매개변수가 빠져 libpq가 pgAdmin을 실행하는 OS 계정의 기본 파일(~/.pgpass, ~/.postgresql/ 인증서 및 키)을 사용했습니다. 이로 인해 일반 사용자가 서비스 계정의 저장된 비밀번호나 인증서로 서버에 접속할 수 있었습니다. pg_service.conf 항목이나 pg_dumpall의 유지보수 DB 이름을 통해서도 같은 파일이 유틸리티에 노출될 수 있었습니다. 이 문제는 pgAdmin 4 9.19 이전 버전에 영향을 줍니다.
💡 쉬운 설명
pgAdmin이 서버 접속 시 저장된 비밀번호 파일과 인증서를 잘못 가져다 쓸 수 있었습니다. 그래서 권한이 없는 사용자도 서비스 계정의 자격 증명으로 데이터베이스에 접속할 수 있었습니다.
🇺🇸 원문 (English)
When a server in pgAdmin 4 had no password file, client certificate or client key configured, or the configured one could not be found, pgAdmin left the parameter out of the connection and libpq fell back to the defaults of the operating-system account running pgAdmin: ~/.pgpass, ~/.postgresql/postgresql.crt and postgresql.key, or PGPASSFILE, PGSSLCERT and PGSSLKEY. In server mode any user could therefore connect to a server with the service account's saved passwords or client certificate, and supplying only a copy of its public certificate was enough for libpq to pair it with the service account's private key. A pg_service.conf entry, or a maintenance database name read as a connection string by pg_dumpall, could bring the same files back for the utilities.
The fix gives each of these parameters a value in server mode, the user's own file or otherwise a path that can never be opened, in the connection string, in the environment of the utilities and in the --dbname connection string that ranks above a service entry. Desktop mode is unchanged.
This issue affects pgAdmin 4: before 9.19.
📍 영향받는 시스템
pgAdmin 4 9.19 이전 버전 (서버 모드)
⚔️ 공격 벡터
서버 모드에 로그인한 사용자가 설정 누락을 이용해 서비스 계정의 .pgpass 비밀번호나 클라이언트 인증서/개인키를 재사용하여 PostgreSQL 서버에 무단 접속
🛡️ 대응 방법
pgAdmin 4를 9.19 이상으로 업데이트하고, 서버 모드에서 연결별 비밀번호 파일 및 인증서 경로를 명시적으로 설정
🔧 검증 코드
출력된 버전이 9.19 미만이면 취약하므로 업데이트가 필요하고, 9.19 이상이면 패치된 버전입니다.
pip show pgadmin4 2>/dev/null | grep -i version || dpkg -l pgadmin4 2>/dev/null | grep pgadmin4