2026-11-23 16:59CVE-2026-134848PostgreSQL
PUBLISHED5.2CWE-158

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.

Problem type

Affected products

pgjdbc

pgjdbc

< 42.7.15 - AFFECTED

References

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-134848
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-134848",
    "assignerOrgId": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007",
    "assignerShortName": "PostgreSQL",
    "dateUpdated": "2026-11-23T16:59:18.939Z",
    "dateReserved": "2026-11-22T17:13:47.180Z",
    "datePublished": "2026-11-23T16:59:18.939Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007",
        "shortName": "PostgreSQL",
        "dateUpdated": "2026-11-23T16:59:18.939Z"
      },
      "title": "pgjdbc lets a NUL character in a connection property add startup parameters",
      "descriptions": [
        {
          "lang": "en",
          "value": "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": [
        {
          "vendor": "pgjdbc",
          "product": "pgjdbc",
          "collectionURL": "https://repo.maven.apache.org/maven2",
          "packageName": "org.postgresql:postgresql",
          "programFiles": [
            "pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java"
          ],
          "programRoutines": [
            {
              "name": "org.postgresql.core.v3.ConnectionFactoryImpl.getParametersForStartup"
            }
          ],
          "repo": "https://github.com/pgjdbc/pgjdbc",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "0",
              "status": "affected",
              "versionType": "maven",
              "lessThan": "42.7.15"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-158 Improper Neutralization of Null Byte or NUL Character",
              "cweId": "CWE-158",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-36wf-f6m2-v42m",
          "tags": [
            "vendor-advisory"
          ]
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N",
            "attackVector": "NETWORK",
            "attackComplexity": "HIGH",
            "privilegesRequired": "NONE",
            "userInteraction": "NONE",
            "scope": "UNCHANGED",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "availabilityImpact": "NONE",
            "baseScore": 7.4,
            "baseSeverity": "HIGH"
          }
        }
      ],
      "workarounds": [
        {
          "lang": "en",
          "value": "Refuse a NUL character in connection values that come from untrusted input."
        }
      ],
      "solutions": [
        {
          "lang": "en",
          "value": "Upgrade to pgjdbc 42.7.15 or later."
        }
      ],
      "timeline": [
        {
          "time": "2026-10-08T00:00:00.000Z",
          "lang": "en",
          "value": "Reported by Sehrope Sarkuni."
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Sehrope Sarkuni",
          "type": "finder"
        }
      ]
    }
  }
}