pgjdbc parses quoted text as SQL in JDBC escapes, dollar quotes and E strings
- State
- Published
- Severity
- 8.1 High
- Published
- Nov 23, 2026
- Updated
- Nov 23, 2026
- Reserved
- Nov 22, 2026
Description
pgjdbc, the PostgreSQL JDBC Driver, misreads some quoted text in its query parser. A `}` inside a literal ends a JDBC escape such as `{ts}`, and the rest of the literal is translated as SQL. A dollar quote whose tag has a non-ASCII symbol or space is not recognized. An `E''` string with a doubled quote is scanned as a standard string. `{fn right}` and `{fn timestampdiff}` with a negative argument produce a `--` comment. In each case text that the application quoted correctly can run as SQL with the privileges of the application's database role. All versions before 42.7.15 are affected, and 42.7.15 fixes the problem.
| Product | Versions |
|---|---|
| pgjdbc pgjdbc | before 42.7.15 Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 3.1 | 8.1 High | PostgreSQL |
Weaknesses
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
References
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.