CVE-2026-134842 pgjdbc simple query mode quotes parameters for the wrong standard_conforming_strings value

Published Updated

With simple query mode, pgjdbc may quote parameters for the wrong string setting, letting attackers inject SQL; Java apps using pgjdbc should care.

CVSS score

High

8.1/10

CVSS 3.1 · Scored by PostgreSQL Breakdown
Exploited in the wild
Not known
Not in CISA's KEV catalogue
Exploit code
None known
No public exploit found
Fix
Available
42.7.6, 42.7.15
Attack path
Over the internet
No login, no user action

What is CVE-2026-134842?

CVE-2026-134842 is a high-severity SQL injection vulnerability in pgjdbc, published on 23 Nov 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

pgjdbc, the PostgreSQL JDBC Driver, can quote a string parameter for the wrong value of standard_conforming_strings when preferQueryMode=simple is set. A statement, trigger or configuration reload can turn the setting off during a session. A parameter value with a backslash and a quote then ends the literal, and the rest of the value runs as SQL. Before 42.7.6 any session with the setting off was affected. The statement cache can also reuse a parse made under the other setting. With allowEncodingChanges=true and the EUC_JP or SJIS client encoding, the yen sign acts as a backslash. All versions before 42.7.15 are affected, and 42.7.15 fixes the problem.

Weakness: CWE-89

How severe is CVE-2026-134842?

CVE-2026-134842 scores 8.1 out of 10 under CVSS 3.1, which is high severity. It was scored by PostgreSQL.

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Which versions are affected by CVE-2026-134842?

An affected version is only exploitable if your software uses the vulnerable function or option. Many projects that include it are not exposed.

How do I fix CVE-2026-134842?

Upgrade pgjdbc to the fixed version for your release line. The advisory names 42.7.6 and 42.7.15.

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-2026-134842 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-134842 exists.

Sources

Also known as DEBIAN-CVE-2026-134842, GHSA-6rxc-3r4p-gpff, UBUNTU-CVE-2026-134842.

Is CVE-2026-134842 in your software?

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

Check your SBOMs for free