2026-11-23 16:59CVE-2026-134845PostgreSQL
PUBLISHED5.2CWE-295

pgjdbc does not enforce TLS for some ssl, service and DataSource settings

pgjdbc, the PostgreSQL JDBC Driver, does not enforce TLS for some settings that ask for it. When sslmode is not set, an ssl value such as 1, on, yes or verify-full gives sslmode=prefer, or no TLS before 42.2.5. A service given in the Properties instead of the URL is ignored, so the sslmode of its pg_service.conf entry is lost. BaseDataSource.setUrl() keeps an sslmode, channelBinding or gssEncMode that was set before it. An attacker on the network path can then read and change the traffic. Versions 9.4.1208 through 42.7.14 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-134845
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-134845",
    "assignerOrgId": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007",
    "assignerShortName": "PostgreSQL",
    "dateUpdated": "2026-11-23T16:59:16.734Z",
    "dateReserved": "2026-11-22T17:13:47.180Z",
    "datePublished": "2026-11-23T16:59:16.734Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007",
        "shortName": "PostgreSQL",
        "dateUpdated": "2026-11-23T16:59:16.734Z"
      },
      "title": "pgjdbc does not enforce TLS for some ssl, service and DataSource settings",
      "descriptions": [
        {
          "lang": "en",
          "value": "pgjdbc, the PostgreSQL JDBC Driver, does not enforce TLS for some settings that ask for it. When sslmode is not set, an ssl value such as 1, on, yes or verify-full gives sslmode=prefer, or no TLS before 42.2.5. A service given in the Properties instead of the URL is ignored, so the sslmode of its pg_service.conf entry is lost. BaseDataSource.setUrl() keeps an sslmode, channelBinding or gssEncMode that was set before it. An attacker on the network path can then read and change the traffic. Versions 9.4.1208 through 42.7.14 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/jdbc/SslMode.java",
            "pgjdbc/src/main/java/org/postgresql/Driver.java",
            "pgjdbc/src/main/java/org/postgresql/ds/common/BaseDataSource.java"
          ],
          "programRoutines": [
            {
              "name": "org.postgresql.jdbc.SslMode.of"
            },
            {
              "name": "org.postgresql.Driver.parseURL"
            },
            {
              "name": "org.postgresql.ds.common.BaseDataSource.setUrl"
            }
          ],
          "repo": "https://github.com/pgjdbc/pgjdbc",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "9.4.1208",
              "status": "affected",
              "versionType": "maven",
              "lessThan": "42.7.15"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-295 Improper Certificate Validation",
              "cweId": "CWE-295",
              "type": "CWE"
            },
            {
              "lang": "en",
              "description": "CWE-319 Cleartext Transmission of Sensitive Information",
              "cweId": "CWE-319",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-3mrw-838h-x9j9",
          "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": "Set sslmode=verify-full in the URL or the Properties, and pass a service name in the URL."
        }
      ],
      "solutions": [
        {
          "lang": "en",
          "value": "Upgrade to pgjdbc 42.7.15 or later. From 42.7.15 an ssl value other than true, false or empty is refused."
        }
      ],
      "timeline": [
        {
          "time": "2026-10-16T00:00:00.000Z",
          "lang": "en",
          "value": "Reported by Anthropic OSS Scanner (ANT-2026-JON5W0PA)."
        },
        {
          "time": "2026-10-16T00:00:00.000Z",
          "lang": "en",
          "value": "Reported by Anthropic OSS Scanner (ANT-2026-CHV7PJLQ)."
        },
        {
          "time": "2026-10-16T00:00:00.000Z",
          "lang": "en",
          "value": "Reported by Anthropic OSS Scanner (ANT-2026-QMR87C71)."
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Anthropic OSS Scanner (ANT-2026-JON5W0PA)",
          "type": "finder"
        },
        {
          "lang": "en",
          "value": "Anthropic OSS Scanner (ANT-2026-CHV7PJLQ)",
          "type": "finder"
        },
        {
          "lang": "en",
          "value": "Anthropic OSS Scanner (ANT-2026-QMR87C71)",
          "type": "finder"
        }
      ]
    }
  }
}