CVE-2026-42198
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
The PostgreSQL JDBC Driver (pgjdbc) allows Java programs to connect to a PostgreSQL database using standard, database independent Java code. It is an open-source, pure Java (Type 4) JDBC driver that communicates with the server using the PostgreSQL native network protocol.
A denial of service vulnerability (CVE-2026-42198) has been identified in the SCRAM-SHA-256 authentication of the PostgreSQL JDBC Driver, which allows attackers who control or impersonate a PostgreSQL server to exhaust client CPU by advertising an extremely large PBKDF2 iteration count. Repeated or concurrent connection attempts can exhaust the client host's CPU and stall connection pools.
Per OWASP: The Denial of Service (DoS) attack is focused on making a resource (site, application, server) unavailable for the purpose it was designed.
This issue affects multiple versions of the PostgreSQL JDBC Driver.
Details
Module Info
- Product: PostgreSQL JDBC Driver
- Affected packages:
org.postgresql:postgresql - Affected versions: >=42.2.0 <42.7.11
- GitHub repository: https://github.com/pgjdbc/pgjdbc
- Published packages: https://central.sonatype.com/artifact/org.postgresql/postgresql
- Package manager: Maven
- Fixed in:
- OSS PostgreSQL JDBC Driver 42.7.11
- NES for PostgreSQL JDBC Driver v42.3.12
Vulnerability Info
This High-severity vulnerability is found in the org.postgresql:postgresql package in multiple versions of the PostgreSQL JDBC Driver. During SCRAM-SHA-256 authentication the server's server-first-message supplies the salt and the PBKDF2 iteration count that the client must use to derive the salted password. The driver accepts whatever iteration count the server sends and immediately computes the client proof with it. In the 42.3.x line, ScramAuthenticator.processServerFirstMessage only logs the iteration count before deriving the proof:
if (LOGGER.isLoggable(Level.FINEST)) {
LOGGER.log(Level.FINEST,
" <=BE AuthenticationSASLContinue(salt={0}, iterations={1})",
new Object[] { serverFirstProcessor.getSalt(), serverFirstProcessor.getIteration() }
);
}
clientFinalProcessor = serverFirstProcessor.clientFinalProcessor(password);clientFinalProcessor(password) runs the full PBKDF2 derivation with the server-chosen iteration count, and there is no upper bound on that value. A malicious, compromised or impersonated PostgreSQL endpoint can therefore advertise a huge iteration count and keep a client CPU core busy for an arbitrary amount of time before authentication can fail. This is reachable whenever an application connects with SCRAM-SHA-256 to an endpoint an attacker controls, for example when tenants or end users supply their own connection details, when connection targets come from untrusted configuration, or when an attacker can redirect or intercept the connection because the server identity is not verified (sslmode below verify-full). loginTimeout does not stop the work: when it expires the caller stops waiting, but the worker thread performing the connection attempt keeps computing PBKDF2. Connection retries and parallel connection attempts multiply the cost, so a handful of attempts can exhaust the client host's CPU and wedge its connection pools.
Mitigation
Release lines of the PostgreSQL JDBC Driver other than the latest 42.x and 42.2.x are End-of-Life for regular maintenance and receive upstream security fixes only upon request, so older versions may not receive updates to address this issue. For more information, see here.
Users of the affected components should apply one of the following mitigations:
- Upgrade affected applications to a currently supported version of the PostgreSQL JDBC Driver that contains the fix.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
- Sehrope Sarkuni from JackDB, Inc. (finder)