CVE-2026-134847 in pgjdbc
Summary
by MITRE • 11/23/2026
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.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 11/26/2026
The PostgreSQL JDBC Driver contains a critical implementation flaw in its handling of BigDecimal values during binary protocol transmission that leads to significant data integrity issues and potential denial-of-service conditions. When the driver transmits numeric types using the default binary format, it incorrectly truncates both the weight and scale components of the Java BigDecimal object to fit within 16-bit integer fields. This architectural oversight fundamentally breaks the fidelity of high-precision decimal arithmetic expected by enterprise applications relying on PostgreSQL for financial or scientific calculations. The vulnerability allows values with extreme exponents to be processed without raising appropriate exceptions, resulting in silent data corruption where the stored value differs drastically from the intended input.
The operational impact manifests primarily through two distinct attack vectors: precision loss and resource exhaustion. In cases involving large-scale truncation, such as when a tiny value like 999999.99e-262144 is transmitted, the driver's logic fails to preserve the magnitude of the number. Instead of storing the intended infinitesimally small decimal, the server interprets the corrupted binary payload and stores it as a standard large integer, specifically 999999.99 in this example. This behavior violates fundamental database integrity principles where data types must accurately reflect their declared precision and scale. Applications performing range checks or relying on exact arithmetic will receive incorrect results, potentially leading to severe logical errors in downstream processing pipelines that assume the stored value matches the application-level validation constraints.
A more severe consequence arises from how the driver computes intermediate values during this flawed process. The implementation attempts to calculate ten raised to the power of the scale factor before transmission or storage operations are completed. When an attacker supplies a BigDecimal with an extremely large negative exponent, such as 1e-200000000, the computational effort required to resolve this value becomes prohibitive. Because the driver does not validate the magnitude of the exponent against reasonable bounds prior to computation, it initiates intensive mathematical operations that consume significant CPU resources for extended periods. This effectively creates a local denial-of-service condition where application threads are held busy calculating impossible or excessively large powers, leading to thread pool exhaustion and service unavailability for other users sharing the same database connection infrastructure.
This vulnerability aligns with CWE-20 Improper Input Validation as the driver fails to adequately sanitize or bound the input parameters related to numeric precision before processing. Furthermore, it relates to CWE-190 Integer Overflow or Wraparound due to the truncation of weight and scale values into insufficient bit widths, which distorts the numerical representation. From a threat modeling perspective utilizing MITRE ATT&CK techniques, this flaw can be leveraged for Denial of Service via Resource Exhaustion (T1499) by exploiting the computational complexity of large exponent calculations. It also represents an Integrity Violation where data is altered during transit between the client and server without detection or error reporting.
To mitigate these risks, organizations must immediately upgrade pgjdbc to version 42.7.15 or later, which addresses the truncation logic and adds proper bounds checking for scale and weight values. Until upgrading is feasible, application-level validation should be implemented to restrict the precision and scale of BigDecimal inputs before they are passed to the JDBC driver. Developers should also consider disabling binary transfer mode by setting useBinaryMode=false in the connection string as a temporary workaround, although this may impact performance. Regular auditing of database logs for unexpected numeric conversions or high CPU usage spikes can help detect exploitation attempts targeting these computational weaknesses.