CVE-2026-134848: pgjdbc lets a NUL character in a connection property add startup parameters
pgjdbc, the PostgreSQL JDBC Driver, does not refuse a NUL character in a startup parameter. The StartupMessage is a list of NUL-terminated strings, so a NUL in the database name, user, currentSchema, options or ApplicationName adds further parameters. %00 in a URL decodes to a NUL. Someone who controls part of the URL or a property can choose another login role or add replication=database, although the connection still has to pass the authentication of that role. On a server that trusts the client, the attacker can log in as any role. All versions before 42.7.15 are affected, and 42.7.15 fixes the problem.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pgjdbcto a version that resolves this vulnerability.Fixed in 42.7.15
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using pgjdbc versions before 42.7.15 are affected if an attacker can control any part of the JDBC URL or connection properties that supplies the database name, user, currentSchema, options, or ApplicationName.
What does an attacker need to exploit it?
The attacker needs control over a relevant connection value and can inject a NUL character, including through %00 in a URL. The resulting connection must still authenticate successfully as the injected login role, except on servers that trust the client.
Are trust-based PostgreSQL deployments at greater risk?
Yes. When the PostgreSQL server trusts the client, an attacker can use the injected startup parameter to log in as any role.
What should be done if an immediate upgrade is not possible?
Do not allow untrusted input to control JDBC URLs or the affected connection properties, and reject NUL characters and %00-encoded NULs in those values. Ensure the PostgreSQL server does not use client-trusting authentication where untrusted clients can connect.
How can I determine whether my deployment is affected?
Check the pgjdbc version in use: versions earlier than 42.7.15 are affected. Also identify whether externally controlled values can reach the JDBC URL or the database name, user, currentSchema, options, or ApplicationName properties.