GHSA-xfg6-62px-cxc2: Duplicate Advisory SQL Injection Vulnerability

CRITICAL
CVSS 10.0
CWE-89
Published
Advisory Summary

GHSA-xfg6-62px-cxc2 is a CRITICAL (CVSS 10.0) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Duplicate Advisory libraries in the Maven ecosystem. The issue involves sql injection in pgjdbc. Remediation is available by upgrading affected packages to version 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, 42.2.8.

GHSA-xfg6-62px-cxc2 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xfg6-62px-cxc2
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Duplicate Advisory
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 10.0

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:C/C:H/I:H/A:H).

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

How to Fix GHSA-xfg6-62px-cxc2

To remediate this vulnerability, upgrade all affected Duplicate Advisory 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.2
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.7.2</version>
</dependency>
org.postgresql:postgresql fixed: 42.6.1
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.6.1</version>
</dependency>
org.postgresql:postgresql fixed: 42.5.5
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.5.5</version>
</dependency>
org.postgresql:postgresql fixed: 42.4.4
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.4.4</version>
</dependency>
org.postgresql:postgresql fixed: 42.3.9
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.3.9</version>
</dependency>
org.postgresql:postgresql fixed: 42.2.8
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.8</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 GHSA-xfg6-62px-cxc2, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.postgresql

Analyze the terminal output to locate any version of Duplicate Advisory in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 42.7.2), 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-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Duplicate Advisory, 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

## Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-24rp-q3w6-vc56. This link is maintained to preserve external references. ## Original Description pgjdbc, the PostgreSQL JDBC Driver, allows attacker to inject SQL if using PreferQueryMode=SIMPLE. Note this is not the default. In the default mode there is no vulnerability. A placeholder for a numeric value must be immediately preceded by a minus. There must be a second placeholder for a string value after the first placeholder; both must be on the same line. By constructing a matching string payload, the attacker can inject SQL to alter the query,bypassing the protections that parameterized queries bring against SQL Injection attacks. Versions before 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, and 42.2.8 are affected.

GHSA-xfg6-62px-cxc2 Affected Duplicate Advisory Versions

6 component(s)
Fixed Versions:
42.7.242.6.142.5.542.4.442.3.942.2.8
Product / Package Ecosystem Affected Versions Fixed Version
org.postgresql:postgresql
Maven
≥ 42.7.0
< 42.7.2
42.7.2
org.postgresql:postgresql
Maven
≥ 42.6.0
< 42.6.1
42.6.1
org.postgresql:postgresql
Maven
≥ 42.5.0
< 42.5.5
42.5.5
org.postgresql:postgresql
Maven
≥ 42.4.0
< 42.4.4
42.4.4
org.postgresql:postgresql
Maven
≥ 42.3.0
< 42.3.9
42.3.9
org.postgresql:postgresql
Maven
< 42.2.8
42.2.8

References

Frequently Asked Questions

What is GHSA-xfg6-62px-cxc2?
GHSA-xfg6-62px-cxc2 is a security vulnerability in Duplicate Advisory involving SQL injection in pgjdbc under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Duplicate Advisory versions are affected?
Affected versions include releases prior to 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, 42.2.8 across affected packages: org.postgresql:postgresql.
What version fixes GHSA-xfg6-62px-cxc2?
Upgrading to 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, 42.2.8 (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.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, 42.2.8. Upgrade your dependency to 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, 42.2.8 or later.
What is the CVSS score of GHSA-xfg6-62px-cxc2?
GHSA-xfg6-62px-cxc2 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with GHSA-xfg6-62px-cxc2?
GHSA-xfg6-62px-cxc2 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Maven dependencies for GHSA-xfg6-62px-cxc2?
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-xfg6-62px-cxc2",
  "modified" : "2024-06-10T18:30:52Z",
  "published" : "2024-02-19T15:30:38Z",
  "withdrawn" : "2024-02-21T23:18:25Z",
  "aliases" : [ ],
  "summary" : "Duplicate Advisory: SQL injection in pgjdbc",
  "details" : "## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-24rp-q3w6-vc56. This link is maintained to preserve external references.\n\n## Original Description\npgjdbc, the PostgreSQL JDBC Driver, allows attacker to inject SQL if using PreferQueryMode=SIMPLE. Note this is not the default. In the default mode there is no vulnerability. A placeholder for a numeric value must be immediately preceded by a minus. There must be a second placeholder for a string value after the first placeholder; both must be on the same line. By constructing a matching string payload, the attacker can inject SQL to alter the query,bypassing the protections that parameterized queries bring against SQL Injection attacks. Versions before 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, and 42.2.8 are affected.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.postgresql:postgresql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.7.0"
      }, {
        "fixed" : "42.7.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.postgresql:postgresql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.6.0"
      }, {
        "fixed" : "42.6.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.postgresql:postgresql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.5.0"
      }, {
        "fixed" : "42.5.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.postgresql:postgresql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.4.0"
      }, {
        "fixed" : "42.4.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.postgresql:postgresql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "42.3.0"
      }, {
        "fixed" : "42.3.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.postgresql:postgresql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "42.2.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-1597"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pgjdbc/pgjdbc/commit/06abfb78a627277a580d4df825f210e96a4e14ee"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pgjdbc/pgjdbc/commit/93b0fcb2711d9c1e3a2a03134369738a02a58b40"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pgjdbc/pgjdbc"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240419-0008"
  }, {
    "type" : "WEB",
    "url" : "https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes"
  }, {
    "type" : "WEB",
    "url" : "https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2024/04/02/6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-21T00:04:53Z",
    "nvd_published_at" : "2024-02-19T13:15:07Z"
  }
}