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

Published Nov 23, 2026
·
Updated

pgjdbc, the PostgreSQL JDBC Driver, can quote a string parameter for the wrong value of standardconformingstrings 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 EUCJP 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.

Affected Software

1 affected component
maven/org.postgresql/postgresql<42.7.15

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 42.7.15

Event History

Nov 23, 2026
CVE Published
via MITRE·04:59 PM
Data Sourced
via MITRE·04:59 PM
RemedyDescriptionSeverityWeakness
Data Sourced
via NVD·05:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using pgjdbc versions before 42.7.15 are affected when preferQueryMode=simple is set. The issue can be triggered if standard_conforming_strings is turned off during a session; before 42.7.6, any session with that setting off was affected.

2

What conditions are needed for SQL injection?

An attacker needs to control a string parameter containing both a backslash and a quote after the driver has quoted it for the wrong standard_conforming_strings setting. The quote can terminate the SQL literal and cause the remaining parameter content to execute as SQL.

3

Are there encoding-specific considerations?

Yes. With allowEncodingChanges=true and an EUC_JP or SJIS client encoding, a yen sign is treated as a backslash, which can satisfy the backslash condition.

4

What should be done if an immediate upgrade is not possible?

Avoid preferQueryMode=simple and prevent standard_conforming_strings from being turned off during sessions. Also avoid allowEncodingChanges=true with EUC_JP or SJIS client encodings.

5

What version fixes the issue?

pgjdbc 42.7.15 fixes the problem. All versions before 42.7.15 are affected.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203