Описание
Improper authentication in PgBouncer 1.17.0 through 1.26.0 allows a remote attacker who knows the password of a user listed in auth_file to log in as any other user that authenticates using SCRAM, including PgBouncer admin users and backend superusers. A second StartupMessage sent during SCRAM authentication against a non-existent database is not rejected and switches the user being logged in as, while the SCRAM exchange is still verified against the keys of the first user.
A flaw was found in PgBouncer. An improper authentication vulnerability allows a remote attacker possessing valid credentials for any listed user to impersonate any other user configured with Salted Challenge Response Authentication Mechanism (SCRAM), including PgBouncer administrators and backend superusers. By sending a second connection startup message targeted at a non-existent database during an active SCRAM exchange, the target identity is switched while authentication is verified against the initial user credentials. This issue enables an authenticated attacker to achieve privilege escalation and obtain unauthorized administrative access across the database environment.
Отчет
Red Hat has evaluated this vulnerability as Important severity because an authenticated remote user with valid credentials can gain unauthorized administrative privileges over the database tier, potentially compromising data confidentiality and integrity across all managed databases. Although exploitation requires legitimate credentials for at least one account, the ability to jump from low-privilege client access to backend superuser status represents a substantial escalation beyond expected authorization boundaries. In typical Red Hat environments where PgBouncer pools connections for external applications, exposing the pooler to multiple untrusted or semi-trusted tenants elevates the risk of complete infrastructure takeover.
Меры по смягчению последствий
Limit network access to the PgBouncer daemon so that only trusted application hosts can establish connections.
- Using firewalld, restrict traffic on the PgBouncer port (default 6432/tcp) to specific authorized client IP addresses:
firewall-cmd --permanent --zone=trusted --add-source=<TRUSTED_CLIENT_IP>
firewall-cmd --permanent --zone=trusted --add-port=6432/tcp
firewall-cmd --permanent --remove-port=6432/tcp --zone=public
firewall-cmd --reload
Alternatively, if clients reside on the same host, bind PgBouncer exclusively to the loopback interface by configuring listen_addr = 127.0.0.1 in /etc/pgbouncer/pgbouncer.ini and applying changes:
systemctl reload pgbouncer
Caveats: Restricting network reachability prevents untrusted network hosts from connecting, but it does not protect against malicious or compromised clients residing within the permitted network range. Modifying firewall rules or reloading the PgBouncer service may briefly disrupt active client connections.
Дополнительная информация
Статус:
EPSS
8.8 High
CVSS3
Связанные уязвимости
Improper authentication in PgBouncer 1.17.0 through 1.26.0 allows a remote attacker who knows the password of a user listed in auth_file to log in as any other user that authenticates using SCRAM, including PgBouncer admin users and backend superusers. A second StartupMessage sent during SCRAM authentication against a non-existent database is not rejected and switches the user being logged in as, while the SCRAM exchange is still verified against the keys of the first user.
Improper authentication in PgBouncer 1.17.0 through 1.26.0 allows a remote attacker who knows the password of a user listed in auth_file to log in as any other user that authenticates using SCRAM, including PgBouncer admin users and backend superusers. A second StartupMessage sent during SCRAM authentication against a non-existent database is not rejected and switches the user being logged in as, while the SCRAM exchange is still verified against the keys of the first user.
Authentication bypass via second StartupMessage during SCRAM authentication in PgBouncer
Improper authentication in PgBouncer 1.17.0 through 1.26.0 allows a re ...
Improper authentication in PgBouncer 1.17.0 through 1.26.0 allows a remote attacker who knows the password of a user listed in auth_file to log in as any other user that authenticates using SCRAM, including PgBouncer admin users and backend superusers. A second StartupMessage sent during SCRAM authentication against a non-existent database is not rejected and switches the user being logged in as, while the SCRAM exchange is still verified against the keys of the first user.
EPSS
8.8 High
CVSS3