🇰🇷 한글 설명
서버 모드 pgAdmin 4에서 인증 소스별로 계정을 따로 관리하여, 동일한 사용자명이 내부 계정과 LDAP 계정으로 각각 존재할 수 있습니다. LDAP 또는 Kerberos 인증 후 사용자명만으로 계정을 선택하거나 로그인 폼이 조회한 계정을 출처 검증 없이 사용하여, 다른 계정(관리자 계정 포함)의 세션으로 로그인될 수 있습니다. 이 취약점은 pgAdmin 9.19 이전 버전에 영향을 줍니다.
💡 쉬운 설명
LDAP이나 Kerberos로 로그인한 사용자가 이름이 같은 내부 계정, 심지어 관리자 계정으로 잘못 연결될 수 있습니다. 이 경우 해당 계정의 서버 정보와 저장된 데이터베이스 비밀번호에 접근하게 됩니다.
🇺🇸 원문 (English)
In server mode pgAdmin 4 keeps an account per authentication source, so the same username can exist as, for example, an internal account and an LDAP account. After LDAP or Kerberos authenticated a user, pgAdmin chose the account to log in by username alone, or took the account Flask-Security's login form had looked up, without checking that it came from the source that authenticated the user. The session therefore belonged to another account, with its role, its servers and its saved database passwords:
- An LDAP or Kerberos user whose username matched an internal account was logged in as that internal account, including the administrator account created when pgAdmin is first set up.
- With internal authentication listed before LDAP or Kerberos in AUTHENTICATION_SOURCES, the login form's internal validation looks up the account whose email was typed and keeps it even though its password does not match. A Kerberos user could type another Kerberos user's principal and be logged in as that user, and an LDAP user could do the same with an LDAP account whose email is their username.
Exploitation requires valid credentials for an LDAP directory or Kerberos realm that pgAdmin is configured to use.
The fix looks the account up by the authenticated username and the source that authenticated it, and no longer uses the account the login form found for any source but internal authentication. Internal authentication logs in that account only if it is an internal account. Desktop mode is not affected.
This issue affects pgAdmin 4: before 9.19.
📍 영향받는 시스템
서버 모드로 실행되는 pgAdmin 4 9.19 이전 버전 (LDAP/Kerberos 인증 사용 환경)
⚔️ 공격 벡터
pgAdmin이 사용하는 LDAP 디렉터리 또는 Kerberos 레름의 유효한 자격 증명을 가진 공격자가 동일한 사용자명의 내부 계정으로 로그인
🛡️ 대응 방법
pgAdmin 4를 9.19 이상 버전으로 업그레이드
🔧 검증 코드
출력된 버전이 9.19 미만이면 취약하며, 9.19 이상이면 패치가 적용된 것입니다.
pgadmin4 --version 2>/dev/null || dpkg -l pgadmin4 2>/dev/null | grep pgadmin4