CVE-2021-3935 SQL injection in pgbouncer

High 8.1 Published Updated

A man-in-the-middle attacker can inject arbitrary SQL queries during connection establishment in PgBouncer when cert authentication is enabled.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-3935?

CVE-2021-3935 is a high-severity SQL injection vulnerability in Debian Debian Linux, published on 22 Nov 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

When PgBouncer is configured to use "cert" authentication, a man-in-the-middle attacker can inject arbitrary SQL queries when a connection is first established, despite the use of TLS certificate verification and encryption. This flaw affects PgBouncer versions prior to 1.16.1.

Weakness: CWE-295, CWE-89

Which versions are affected by CVE-2021-3935?

1 open source package ship an affected version, including pgbouncer. It affects 4 products.

PackageAffectedFixed in
pgbouncer BitnamiAll versions1.16.1

Products include Debian Debian Linux, Fedoraproject Fedora, Pgbouncer Pgbouncer, Redhat Enterprise Linux.

How do I fix CVE-2021-3935?

Upgrade pgbouncer to 1.16.1 or later.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2021-3935 being exploited?

There is no known exploitation of CVE-2021-3935 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as BIT-pgbouncer-2021-3935, CLEANSTART-2026-MZ91907, DEBIAN-CVE-2021-3935, DLA-2922-1, GHSA-jh4v-gqwq-hfrr, UBUNTU-CVE-2021-3935.

Is CVE-2021-3935 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free