CVE-2025-49146: Postgresql Pgjdbc Client Allows Fallback To Vulnerability

HIGH
Advisory Identifier: GHSA-hq9p-pm7w-8p54
CVSS 8.2
CWE-287
Published
Advisory Summary

CVE-2025-49146 is a HIGH (CVSS 8.2) pgjdbc client allows fallback to vulnerability (CWE-287: Improper Authentication) affecting Postgresql libraries in the Maven ecosystem. The issue involves pgjdbc client allows fallback to insecure authentication despite channelbinding=require configuration. Remediation is available by upgrading affected packages to version 42.7.7.

CVE-2025-49146 at a Glance

CVE Identifier CVE-2025-49146
GHSA Identifier GHSA-hq9p-pm7w-8p54
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-287: Improper Authentication
Affected Product Postgresql
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-49146

To remediate this vulnerability, upgrade all affected Postgresql dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.postgresql:postgresql fixed: 42.7.7
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.7.7</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.postgresql

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2025-49146, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.postgresql

Analyze the terminal output to locate any version of Postgresql in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 42.7.7), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.postgresql command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Postgresql, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact When the PostgreSQL JDBC driver is configured with channel binding set to `required` (default value is `prefer`), the driver would incorrectly allow connections to proceed with authentication methods that do not support channel binding (such as password, MD5, GSS, or SSPI authentication). This could allow a man-in-the-middle attacker to intercept connections that users believed were protected by channel binding requirements. ### Patches TBD ### Workarounds Configure `sslMode=verify-full` to prevent MITM attacks. ### References * https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256 * https://datatracker.ietf.org/doc/html/rfc7677 * https://datatracker.ietf.org/doc/html/rfc5802

CVE-2025-49146 Affected Postgresql Versions

1 component(s)
Fixed Versions:
42.7.7
Product / Package Ecosystem Affected Versions Fixed Version
org.postgresql:postgresql
Maven
≥ 42.7.4
< 42.7.7
42.7.7

References

Frequently Asked Questions

What is CVE-2025-49146?
CVE-2025-49146 is a security vulnerability in Postgresql involving pgjdbc Client Allows Fallback to Insecure Authentication Despite channelBinding=require Configuration under CWE-287: Improper Authentication.
Which Postgresql versions are affected?
Affected versions include releases prior to 42.7.7 across affected packages: org.postgresql:postgresql.
What version fixes CVE-2025-49146?
Upgrading to 42.7.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is postgresql affected?
Yes, org.postgresql:postgresql is affected in releases prior to 42.7.7. Upgrade your dependency to 42.7.7 or later.
What is the CVSS score of CVE-2025-49146?
CVE-2025-49146 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2025-49146?
CVE-2025-49146 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Maven dependencies for CVE-2025-49146?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.postgresql'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hq9p-pm7w-8p54",
  "modified" : "2025-06-11T16:17:03Z",
  "published" : "2025-06-11T14:44:04Z",
  "aliases" : [ "CVE-2025-49146" ],
  "summary" : "pgjdbc Client Allows Fallback to Insecure Authentication Despite channelBinding=require Configuration",
  "details" : "### Impact\nWhen the PostgreSQL JDBC driver is configured with channel binding set to `required` (default value is `prefer`), the driver would incorrectly allow connections to proceed with authentication methods that do not support channel binding (such as password, MD5, GSS, or SSPI  authentication). This could allow a man-in-the-middle attacker to intercept connections that users believed were protected by channel binding requirements.\n\n### Patches\nTBD\n\n### Workarounds\n\nConfigure `sslMode=verify-full` to prevent MITM attacks.\n\n### References\n\n* https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256\n* https://datatracker.ietf.org/doc/html/rfc7677\n* https://datatracker.ietf.org/doc/html/rfc5802",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.postgresql:postgresql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.7.4"
      }, {
        "fixed" : "42.7.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-hq9p-pm7w-8p54"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-49146"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pgjdbc/pgjdbc/commit/9217ed16cb2918ab1b6b9258ae97e6ede244d8a0"
  }, {
    "type" : "WEB",
    "url" : "https://datatracker.ietf.org/doc/html/rfc5802"
  }, {
    "type" : "WEB",
    "url" : "https://datatracker.ietf.org/doc/html/rfc7677"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pgjdbc/pgjdbc"
  }, {
    "type" : "WEB",
    "url" : "https://www.postgresql.org/docs/current/sasl-authentication.html#SASL-SCRAM-SHA-256"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-11T14:44:04Z",
    "nvd_published_at" : "2025-06-11T15:15:42Z"
  }
}