CVE-2024-1597 (GCVE-0-2024-1597)

Vulnerability from cvelistv5 – Published: 2024-02-19 12:58 – Updated: 2025-11-03 21:52
VLAI?
Title
pgjdbc SQL Injection via line comment generation
Summary
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.28 are affected.
CWE
  • CWE-89 - Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Assigner
Impacted products
Vendor Product Version
pgjdbc pgjdbc Affected: < 42.7.2
Affected: < 42.6.1
Affected: < 42.5.5
Affected: < 42.4.4
Affected: < 42.3.9
Affected: < 42.2.28
Create a notification for this product.
Credits
The pgjdbc project thanks Paul Gerste for reporting this problem.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "affected": [
          {
            "cpes": [
              "cpe:2.3:a:pgjdbc:pgjdbc:*:*:*:*:*:*:*:*"
            ],
            "defaultStatus": "unknown",
            "product": "pgjdbc",
            "vendor": "pgjdbc",
            "versions": [
              {
                "lessThan": "42.7.2",
                "status": "affected",
                "version": "0",
                "versionType": "custom"
              },
              {
                "lessThan": "42.6.1",
                "status": "affected",
                "version": "0",
                "versionType": "custom"
              },
              {
                "lessThan": "42.5.5",
                "status": "affected",
                "version": "0",
                "versionType": "custom"
              },
              {
                "lessThan": "42.4.4",
                "status": "affected",
                "version": "0",
                "versionType": "custom"
              },
              {
                "lessThan": "42.3.9",
                "status": "affected",
                "version": "0",
                "versionType": "custom"
              },
              {
                "lessThan": "42.2.28",
                "status": "affected",
                "version": "0",
                "versionType": "custom"
              }
            ]
          }
        ],
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-1597",
                "options": [
                  {
                    "Exploitation": "poc"
                  },
                  {
                    "Automatable": "yes"
                  },
                  {
                    "Technical Impact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-04-10T04:00:36.120593Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-07-30T16:53:44.796Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2025-11-03T21:52:29.022Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "url": "https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://security.netapp.com/advisory/ntap-20240419-0008/"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "http://www.openwall.com/lists/oss-security/2024/04/02/6"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html"
          },
          {
            "url": "https://lists.debian.org/debian-lts-announce/2024/12/msg00017.html"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "product": "pgjdbc",
          "vendor": "pgjdbc",
          "versions": [
            {
              "status": "affected",
              "version": "\u003c 42.7.2"
            },
            {
              "status": "affected",
              "version": "\u003c 42.6.1"
            },
            {
              "status": "affected",
              "version": "\u003c 42.5.5"
            },
            {
              "status": "affected",
              "version": "\u003c 42.4.4"
            },
            {
              "status": "affected",
              "version": "\u003c 42.3.9"
            },
            {
              "status": "affected",
              "version": "\u003c 42.2.28"
            }
          ]
        }
      ],
      "configurations": [
        {
          "lang": "en",
          "value": "Client must run code with PreferQueryMode=Simple"
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "The pgjdbc project thanks Paul Gerste for reporting this problem."
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "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.28 are affected."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "attackComplexity": "LOW",
            "attackVector": "NETWORK",
            "availabilityImpact": "HIGH",
            "baseScore": 10,
            "baseSeverity": "CRITICAL",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "privilegesRequired": "NONE",
            "scope": "CHANGED",
            "userInteraction": "NONE",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
            "version": "3.1"
          }
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-89",
              "description": "Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-06-10T16:14:25.740Z",
        "orgId": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007",
        "shortName": "PostgreSQL"
      },
      "references": [
        {
          "url": "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56"
        },
        {
          "url": "https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/"
        },
        {
          "url": "https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/"
        },
        {
          "url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/"
        },
        {
          "url": "https://security.netapp.com/advisory/ntap-20240419-0008/"
        },
        {
          "url": "http://www.openwall.com/lists/oss-security/2024/04/02/6"
        },
        {
          "url": "https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html"
        }
      ],
      "title": "pgjdbc SQL Injection via line comment generation",
      "workarounds": [
        {
          "lang": "en",
          "value": "Don\u0027t use SimpleQuery mode"
        }
      ]
    }
  },
  "cveMetadata": {
    "assignerOrgId": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007",
    "assignerShortName": "PostgreSQL",
    "cveId": "CVE-2024-1597",
    "datePublished": "2024-02-19T12:58:48.620Z",
    "dateReserved": "2024-02-16T22:29:21.969Z",
    "dateUpdated": "2025-11-03T21:52:29.022Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/\"}, {\"url\": \"https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://security.netapp.com/advisory/ntap-20240419-0008/\", \"tags\": [\"x_transferred\"]}, {\"url\": \"http://www.openwall.com/lists/oss-security/2024/04/02/6\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://lists.debian.org/debian-lts-announce/2024/12/msg00017.html\"}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2025-11-03T21:52:29.022Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2024-1597\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"poc\"}, {\"Automatable\": \"yes\"}, {\"Technical Impact\": \"total\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-04-10T04:00:36.120593Z\"}}}], \"affected\": [{\"cpes\": [\"cpe:2.3:a:pgjdbc:pgjdbc:*:*:*:*:*:*:*:*\"], \"vendor\": \"pgjdbc\", \"product\": \"pgjdbc\", \"versions\": [{\"status\": \"affected\", \"version\": \"0\", \"lessThan\": \"42.7.2\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"0\", \"lessThan\": \"42.6.1\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"0\", \"lessThan\": \"42.5.5\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"0\", \"lessThan\": \"42.4.4\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"0\", \"lessThan\": \"42.3.9\", \"versionType\": \"custom\"}, {\"status\": \"affected\", \"version\": \"0\", \"lessThan\": \"42.2.28\", \"versionType\": \"custom\"}], \"defaultStatus\": \"unknown\"}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-07-30T16:51:07.958Z\"}}], \"cna\": {\"title\": \"pgjdbc SQL Injection via line comment generation\", \"credits\": [{\"lang\": \"en\", \"value\": \"The pgjdbc project thanks Paul Gerste for reporting this problem.\"}], \"metrics\": [{\"cvssV3_1\": {\"scope\": \"CHANGED\", \"version\": \"3.1\", \"baseScore\": 10, \"attackVector\": \"NETWORK\", \"baseSeverity\": \"CRITICAL\", \"vectorString\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H\", \"integrityImpact\": \"HIGH\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"availabilityImpact\": \"HIGH\", \"privilegesRequired\": \"NONE\", \"confidentialityImpact\": \"HIGH\"}}], \"affected\": [{\"vendor\": \"pgjdbc\", \"product\": \"pgjdbc\", \"versions\": [{\"status\": \"affected\", \"version\": \"\u003c 42.7.2\"}, {\"status\": \"affected\", \"version\": \"\u003c 42.6.1\"}, {\"status\": \"affected\", \"version\": \"\u003c 42.5.5\"}, {\"status\": \"affected\", \"version\": \"\u003c 42.4.4\"}, {\"status\": \"affected\", \"version\": \"\u003c 42.3.9\"}, {\"status\": \"affected\", \"version\": \"\u003c 42.2.28\"}]}], \"references\": [{\"url\": \"https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56\"}, {\"url\": \"https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/\"}, {\"url\": \"https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/\"}, {\"url\": \"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/\"}, {\"url\": \"https://security.netapp.com/advisory/ntap-20240419-0008/\"}, {\"url\": \"http://www.openwall.com/lists/oss-security/2024/04/02/6\"}, {\"url\": \"https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html\"}], \"workarounds\": [{\"lang\": \"en\", \"value\": \"Don\u0027t use SimpleQuery mode\"}], \"descriptions\": [{\"lang\": \"en\", \"value\": \"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.28 are affected.\"}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"cweId\": \"CWE-89\", \"description\": \"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)\"}]}], \"configurations\": [{\"lang\": \"en\", \"value\": \"Client must run code with PreferQueryMode=Simple\"}], \"providerMetadata\": {\"orgId\": \"f86ef6dc-4d3a-42ad-8f28-e6d5547a5007\", \"shortName\": \"PostgreSQL\", \"dateUpdated\": \"2024-06-10T16:14:25.740Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2024-1597\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2025-11-03T21:52:29.022Z\", \"dateReserved\": \"2024-02-16T22:29:21.969Z\", \"assignerOrgId\": \"f86ef6dc-4d3a-42ad-8f28-e6d5547a5007\", \"datePublished\": \"2024-02-19T12:58:48.620Z\", \"assignerShortName\": \"PostgreSQL\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…