Notable Changes
Notable changes
Security
- fix: a
}inside a string literal, quoted identifier, dollar quote or comment no longer ends a{d},{t},{ts},{oj}or{escape}JDBC escape, or the text after the arguments of a{fn}escape. Before, the rest of the literal was parsed as SQL and{fn}escapes in it were translated, so quoted text inside such an escape could run as SQL even with its quotes doubled. An unterminated literal inside an escape now fails in the driver, as it does outside of one. This affects all versions through 42.7.14 GHSA-4743-5rfh-f7mp CVE-2026-134841 - fix: the parser now accepts the same identifier and dollar quote tag characters as the backend: every non-ASCII character, including symbols such as
U+00A7, non-ASCII spaces and characters outside the BMP. Before, the driver did not see a dollar quote whose tag had such a character and read the quoted text as SQL: a?became a placeholder, a;split the statement, and JDBC escape processing could create a closing tag that was not in the original text. A surrogate without its other half is the exception: the driver sends it as?, an operator character for the backend, so$$after it starts a dollar quote. This affects all versions through 42.7.14 GHSA-4743-5rfh-f7mp CVE-2026-134841 - fix: an
E''string with a doubled quote or a continuation on a new line is now scanned as one escape string. Before, the driver read the part after''as a standard string, so\'ended the string for the driver but not for the backend. Text in the literal was then treated as SQL, and withpreferQueryMode=simplea parameter value could run as SQL.E''after a vertical tab, which PostgreSQL 17 and later count as whitespace, or after an unpaired surrogate is now also scanned as an escape string. This affects all versions through 42.7.14 GHSA-4743-5rfh-f7mp CVE-2026-134841 - fix:
{fn right(a, b)}and{fn timestampdiff(t, b, c)}now put the subtracted argument in parentheses. Before, an argument that started with a minus sign made--, which commented out the rest of the line, so text after the next newline, even inside a string literal, could run as SQL. The parentheses also fix the result of an expression such as{fn right(a, 1+1)}. The deprecatedEscapedFunctionsclass gets the same change. This affects all versions through 42.7.14 GHSA-4743-5rfh-f7mp CVE-2026-134841 - fix: with
preferQueryMode=simple, a string parameter with a backslash is now sent as anE''literal, which the backend reads the same way whateverstandard_conforming_stringsis. Before, the driver escaped the value for the last setting it knew of. When an earlier statement of a multi-statement query or batch, a trigger or a configuration reload turned the setting off, a value that started with\'ended the literal and the rest of it ran as SQL. This affects all versions through 42.7.14 GHSA-6rxc-3r4p-gpff CVE-2026-134842 - fix: a query parsed while
standard_conforming_stringshad one value is no longer reused from the statement cache after it changes. In simple mode, a statement with a parameter and a backslash that was prepared before the change now fails with SQLState55000when it is executed after it. Before, a query such asSELECT ?, '\', ?kept the placeholders of the old parse, and the second value ran as SQL. This affects all versions through 42.7.14 GHSA-6rxc-3r4p-gpff CVE-2026-134842 - fix: with
standard_conforming_stringsoff, the yen sign (U+00A5) in a string value now gets a backslash before it, and in simple mode such a value is sent asE''. The JDK’s EUC_JP and Shift_JIS charsets encode the yen sign as the byte0x5C, a backslash for the backend, so withallowEncodingChanges=truea value that started with a yen sign and a quote could end the literal and run as SQL. This affects all versions through 42.7.14 GHSA-6rxc-3r4p-gpff CVE-2026-134842 - fix: the connection is now closed when an unchecked exception interrupts a request, not only an
IOException. Before, part of a message could stay in the send buffer, and the backend read the next request as the rest of it. A spooledsetBinaryStream()value executed again after SQLState0A000or26000could make the bytes of a later uploaded value run as a Query message. In simple mode, a parameter that cannot be rendered is now reported as a failed Bind, and the connection stays usable. This affects all versions through 42.7.14 GHSA-cww3-qmc2-mjmr CVE-2026-134843 - fix: executing again a statement whose spooled
setBinaryStream()value was already sent now fails with “Unable to bind parameter values for statement.” and the connection stays usable. Before, it threw aNullPointerException. - fix: a fastpath call whose arguments add up to more than
0x3fffffffbytes now fails with SQLState22023before anything is sent. Before, the message length was added up in anintand could wrap around, so the backend read the rest of the argument data as new messages. - fix:
CopyManagercancelCopy()now closes the connection and stops at the second error from the backend. Before, it kept every exception with no limit, so a server, or an attacker on the network path when the server is not verified, could answer aCOPY TO STDOUTwith CopyData messages until the heap was exhausted, or make the loop run forever after the stream closed. This affects all versions through 42.7.14 GHSA-79c7-9m5j-vqqv - fix: the driver now resolves an unqualified type name, such as
intervalfor aPGIntervalparameter, to the type the server resolves it to, by preferring the type thatpg_type_is_visible()reports. Before, a domain or type with a built-in name in another schema, even the temporary schema of another session, could be used instead, and the server ran the CHECK of that domain in the application’s session. This affects all versions through 42.7.14 GHSA-j75g-99q3-vr5c CVE-2026-134844 - fix: the catalog queries of
PgResultSetMetaData,TypeInfoCacheandPgDatabaseMetaDatanow qualify their operators asOPERATOR(pg_catalog.op)and their functions withpg_catalog. Before, a role that could create objects in a schema of thesearch_pathcould supply an operator with an exact type match, such asoid = int4orname = varchar, and have it run with the privileges of whoever calledgetTableName(),getTables()and many other methods. This affects all versions through 42.7.14 GHSA-j75g-99q3-vr5c CVE-2026-134844 - fix: an
sslvalue other thantrue,falseor the empty value, ignoring case, now fails with “Invalid ssl value” and SQLState08001whensslmodeis not set. Before, values such as1,on,yesorverify-fullsilently gavesslmode=prefer, so the driver continued without TLS when the peer refused it and accepted any certificate. This affects 9.4.1208 through 42.7.14 GHSA-3mrw-838h-x9j9 CVE-2026-134845 - fix: a
servicegiven in the Properties passed togetConnection()is now used when the URL names no service. Before, it was ignored without a warning, including ansslmode=verify-fullin thatpg_service.confentry, and the connection usedsslmode=prefer. An unknown service in the Properties now fails as it does in the URL. This affects 42.3.2 through 42.7.14 GHSA-3mrw-838h-x9j9 CVE-2026-134845 - fix:
BaseDataSource.setUrl()now replaces every property that the URL has. Before, it set a property only when the DataSource did not have it yet, so a secondsetUrl(), or a setter followed bysetUrl(), kept an earliersslmode,channelBindingorgssEncMode, and a latersslmode=verify-fullwas not enforced. Defaults are no longer stored, andgetUrl()lists only the properties that are set. This affects 42.2.6 through 42.7.14 GHSA-3mrw-838h-x9j9 CVE-2026-134845 - fix:
BaseDataSource.getUrl()now throwsIllegalArgumentExceptionfor a server name with a/or?. Before, such a name could add URL properties, which take precedence over all others, for example to turn off certificate checks. This affects all versions through 42.7.14 GHSA-fxh3-3646-629r - fix: an invalid line in
pg_service.confis no longer logged whole. A line with an unknown key now logs the key, and a line without=logs only its line number. Before, a typo such aspassword = secretprinted the password under the default logging setup. - fix: a startup parameter containing a NUL character is now refused with SQLState
22023. The StartupMessage is a sequence of NUL terminated strings, so a NUL in the database name,currentSchemaoroptionsended that value early and turned the rest into further parameters, overridinguserorreplication.%00in a URL decodes to a NUL. This affects all versions through 42.7.14 GHSA-36wf-f6m2-v42m CVE-2026-134848 - fix: a second AuthenticationSASL request in one connection attempt now fails with SQLState
08P01, as in libpq. Before, a server, or anyone on the network path when the server is not verified, could start a new SCRAM exchange after each one and make the driver derive the salted password any number of times. This affects 42.7.11 through 42.7.14 GHSA-52f2-8qjr-7mw4 - fix: with
sslNegotiation=direct, the driver now refuses a peer that did not select the ALPN protocolpostgresql, with libpq’s message. Before, an attacker on the network could send a direct connection to another TLS service with a certificate for the same host, and the driver sent its startup packet there. This affects 42.7.4 through 42.7.14 GHSA-fpmr-jv7c-hwff - fix: with GSS encryption, every outgoing packet now uses the requested privacy, and a write fails when privacy was requested and not applied. Before, one forged server packet with the sealed flag cleared made every later packet integrity-only, so the SQL and parameter values that followed were sent readable. This affects 42.2.15 through 42.7.14 GHSA-hcjc-54fp-2p42 CVE-2026-134846
- fix: with GSS encryption, an incoming packet that is a duplicate, old, out of sequence, after a gap or not encrypted is now refused, and the connection is closed. Before, an attacker on the network path could drop a server reply and deliver an earlier one from the same connection as the answer to the current query. This affects 42.2.15 through 42.7.14 GHSA-hcjc-54fp-2p42 CVE-2026-134846
- fix: only the first 32 characters of
server_versionare now parsed, which is enough for three version parts of up to 10 digits each. Before, the driver parsed a version of any length withjava.text.NumberFormat, which takes time quadratic in the length of a run of digits, so a server, or anyone on the network path undersslmode=prefer, could make a connection attempt use minutes of CPU thatloginTimeoutdid not interrupt. This affects all versions through 42.7.14 GHSA-79c7-9m5j-vqqv - fix: a
server_versionthat parses to 0, such as one the driver does not recognize, is now parsed once per connection. Before, the number was cached with 0 meaning not parsed yet, sogetTypeInfo(),getColumns()and other metadata calls parsed the string again for every row, and a server, or anyone on the network path undersslmode=prefer, could keep one call busy for minutes with a longserver_version. This affects all versions through 42.7.14 GHSA-79c7-9m5j-vqqv - fix: the
AsciiStringInternerof column labels and notification channel names now keeps lookups fast when many labels have the same hash. Before, a peer could makegetConnection()spend minutes of CPU, before authentication under the defaults, with a RowDescription of labels made to collide. The interner is shared by all connections in the JVM. This affects 42.3.1 through 42.7.14 GHSA-5hpm-qxj5-h4ww - fix: a text array whose dimensions need more elements than the value holds, such as a deeply nested value with mostly empty sub-arrays, now fails with SQLState
22000. Before, the driver took each length from the first sub-array and allocated for it, so a value of under 1 KB from a server, or from an attacker on the network path when the server is not verified, could exhaust the heap. This affects all versions through 42.7.14 GHSA-79c7-9m5j-vqqv - fix:
PSQLWarningno longer records a stack trace, which reduces the heap kept per server notice from about 880 to about 160 bytes.getStackTrace()of a server warning is now empty. The warning chains still have no limit. This affects all versions through 42.7.14 GHSA-79c7-9m5j-vqqv - fix: the
XMLReaderof the default XML factory now has the sameEntityResolveras itsDocumentBuilder. Before, a SAX driver that ignores the apache.org features, such as Woodstox, loaded the external DTD of anxmlvalue read withgetSource(SAXSource.class), so whoever could store such a value could make the application send a request to a URL of their choice. This affects 42.2.13 through 42.7.14 GHSA-8f43-r57c-hghq - fix: a
BigDecimalwhose scale or weight does not fit the binary numeric format is now sent as text, and the server reports the overflow. Before, the weight and scale were cut to 16 bits, so999999.99e-262144was stored as999999.99and1e131072as0, and a scale such as in1e-200000000kept a thread busy for minutes before anything was sent. This affects 42.3.0 through 42.7.14 GHSA-cjcw-9r77-4gwm CVE-2026-134847
Changed
- fix: when
sslmodeis not set, thesslconnection property now accepts onlytrue,falseor the empty value, ignoring case. Any other value now makes the connection attempt fail with “Invalid ssl value” and SQLState08001, before a connection is opened. Before, values such as1,on,yes,require,verify-fullortruewith a trailing space were accepted and silently gavesslmode=prefer, which neither requires TLS nor checks the server certificate. Unchanged:trueand the empty value (as in?sslin a URL) still meansslmode=verify-full,falseand nosslproperty still meansslmode=prefer, andsslis still ignored whensslmodeis set. An application that now fails should setsslmodeto the mode it wants, or usessl=trueto require TLS and verify the certificate. This affects 9.4.1208 through 42.7.14 GHSA-3mrw-838h-x9j9 CVE-2026-134845