CVE-2012-1618 Unescaped parameters in the PostgreSQL JDBC driver

High 7.5 Published Updated

Remote attackers can perform SQL injection via improper parameter escaping in the PostgreSQL JDBC driver when standard_conforming_strings is enabled.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2012-1618?

CVE-2012-1618 is a high-severity SQL injection vulnerability in Postgresql Postgresql, published on 6 Oct 2012. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Interaction error in the PostgreSQL JDBC driver before 8.2, when used with a PostgreSQL server with the "standard_conforming_strings" option enabled, such as the default configuration of PostgreSQL 9.1, does not properly escape unspecified JDBC statement parameters, which allows remote attackers to perform SQL injection attacks. NOTE: as of 20120330, it was claimed that the upstream developer planned to dispute this issue, but an official dispute has not been posted as of 20121005.

Which versions are affected by CVE-2012-1618?

2 open source packages ship an affected version, including org.postgresql:postgresql. It affects 2 products.

PackageAffectedFixed in
org.postgresql:postgresql MavenAll versions8.2
org.postgresql:postgresql MavenAll versions8.2

Products include Postgresql Postgresql, Postgresql Postgresql Jdbc Driver.

How do I fix CVE-2012-1618?

Upgrade org.postgresql:postgresql to 8.2 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-2012-1618 being exploited?

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

All Postgresql Postgresql vulnerabilities

Sources

Also known as GHSA-h86w-m5rm-xr33.

Is CVE-2012-1618 in your software?

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

Check your SBOMs for free