2026-11-23 16:59CVE-2026-134847PostgreSQL
PUBLISHED5.2CWE-197

pgjdbc stores a different number for a BigDecimal outside the binary numeric range

pgjdbc, the PostgreSQL JDBC Driver, cuts the weight and scale of a BigDecimal to 16 bits when it sends the value in binary, which is the default. The server then stores a different number without an error. For example 999999.99e-262144 is stored as 999999.99, so a tiny value can pass a range check and be stored as a large one. The driver also computes 10 to the power of the scale first, so a short value such as 1e-200000000 keeps a thread busy for minutes. Versions 42.3.0 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-134847
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-134847",
    "assignerOrgId": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007",
    "assignerShortName": "PostgreSQL",
    "dateUpdated": "2026-11-23T16:59:18.281Z",
    "dateReserved": "2026-11-22T17:13:47.180Z",
    "datePublished": "2026-11-23T16:59:18.281Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007",
        "shortName": "PostgreSQL",
        "dateUpdated": "2026-11-23T16:59:18.281Z"
      },
      "title": "pgjdbc stores a different number for a BigDecimal outside the binary numeric range",
      "descriptions": [
        {
          "lang": "en",
          "value": "pgjdbc, the PostgreSQL JDBC Driver, cuts the weight and scale of a BigDecimal to 16 bits when it sends the value in binary, which is the default. The server then stores a different number without an error. For example 999999.99e-262144 is stored as 999999.99, so a tiny value can pass a range check and be stored as a large one. The driver also computes 10 to the power of the scale first, so a short value such as 1e-200000000 keeps a thread busy for minutes. Versions 42.3.0 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/util/ByteConverter.java",
            "pgjdbc/src/main/java/org/postgresql/jdbc/PgPreparedStatement.java"
          ],
          "programRoutines": [
            {
              "name": "org.postgresql.util.ByteConverter.numeric"
            },
            {
              "name": "org.postgresql.jdbc.PgPreparedStatement.setBigDecimal"
            }
          ],
          "repo": "https://github.com/pgjdbc/pgjdbc",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "42.3.0",
              "status": "affected",
              "versionType": "maven",
              "lessThan": "42.7.15"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-197 Numeric Truncation Error",
              "cweId": "CWE-197",
              "type": "CWE"
            },
            {
              "lang": "en",
              "description": "CWE-400 Uncontrolled Resource Consumption",
              "cweId": "CWE-400",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-cjcw-9r77-4gwm",
          "tags": [
            "vendor-advisory"
          ]
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L",
            "attackVector": "NETWORK",
            "attackComplexity": "LOW",
            "privilegesRequired": "NONE",
            "userInteraction": "NONE",
            "scope": "UNCHANGED",
            "confidentialityImpact": "NONE",
            "integrityImpact": "LOW",
            "availabilityImpact": "LOW",
            "baseScore": 6.5,
            "baseSeverity": "MEDIUM"
          }
        }
      ],
      "workarounds": [
        {
          "lang": "en",
          "value": "Set binaryTransfer=false, or reject BigDecimal values with a very large or very small exponent before binding them."
        }
      ],
      "solutions": [
        {
          "lang": "en",
          "value": "Upgrade to pgjdbc 42.7.15 or later."
        }
      ],
      "timeline": [
        {
          "time": "2026-10-16T00:00:00.000Z",
          "lang": "en",
          "value": "Reported by Anthropic OSS Scanner (ANT-2026-6FX8KOK1)."
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Anthropic OSS Scanner (ANT-2026-6FX8KOK1)",
          "type": "finder"
        }
      ]
    }
  }
}