CVE-2026-120139
Description
A flaw was found in PostgreSQL. An integer wraparound (an arithmetic calculation exceeding numerical limits) occurs during in-memory tuple-size calculations when handling oversized data. An authenticated database user can exploit this flaw to execute arbitrary code with the privileges of the operating system user running the database service.
Statement
This vulnerability is rated as an Important impact by Red Hat Product Security because an authenticated database user can achieve arbitrary code execution within the context of the postgres system user, compromising host and database integrity. While standard deployments on Red Hat Enterprise Linux confine the database process using a dedicated service account and SELinux, exploitation fully exposes the database engine and any data accessible to it. Exploitation requires network reachability and valid database login credentials to submit queries containing crafted, oversized row records. Unauthenticated remote attackers cannot trigger this issue directly.
Mitigation
Restrict network exposure to the PostgreSQL service so that only trusted client hosts and authorized administrators can establish connections.
1. Using firewalld, restrict incoming connections on PostgreSQL port 5432 to a trusted IP address or subnet:
firewall-cmd --permanent --remove-service=postgresql
firewall-cmd --permanent --zone=trusted --add-source=<TRUSTED_IP_RANGE>
firewall-cmd --reload
2. Alternatively, configure PostgreSQL to bind only to local interfaces by modifying `listen_addresses` in `/var/lib/pgsql/data/postgresql.conf`:
listen_addresses = 'localhost'Apply the configuration change by restarting the service:
systemctl restart postgresql
Caveats:
Restricting network connectivity or interface binding prevents remote clients and applications outside the allowed subnet from connecting to the database.
Warning:
Restarting or reloading the PostgreSQL service terminates active client connections and temporarily interrupts database availability.
Common Vulnerability Scoring System (CVSS) Score Details
Info alert:Important note
CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).
The following CVSS metrics and score provided are preliminary and subject to review.
CVSS v3 Score Breakdown
| Red Hat | NVD | cve.org | |
|---|---|---|---|
| Base Score | 8.8 | N/A | 8.8 |
| Attack Vector | Network | N/A | Network |
| Attack Complexity | Low | N/A | Low |
| Privileges Required | Low | N/A | Low |
| User Interaction | None | N/A | None |
| Scope | Unchanged | N/A | Unchanged |
| Confidentiality | High | N/A | High |
| Integrity Impact | High | N/A | High |
| Availability Impact | High | N/A | High |
Vector
Red Hat: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cve.org: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Understanding the Weakness (CWE)
Availability
Technical Impact: DoS: Crash, Exit, or Restart; DoS: Resource Consumption (Memory); DoS: Instability
This weakness can generally lead to undefined behavior and therefore crashes. When the calculated result is used for resource allocation, this weakness can cause too many (or too few) resources to be allocated, possibly enabling crashes if the product requests more resources than can be provided. If the calculated result involves time values, then the product might crash when it encounters a time that is less than the previously-calculated time.
Integrity
Technical Impact: Modify Memory
If the value in question is important to data (as opposed to flow), simple data corruption has occurred. Also, if the overflow/wraparound results in other conditions such as buffer overflows, further memory corruption may occur.
Confidentiality,Availability,Access Control
Technical Impact: Execute Unauthorized Code or Commands; Bypass Protection Mechanism
This weakness can sometimes trigger buffer overflows, which can be used to execute arbitrary code. This is usually outside the scope of the product's implicit security policy.
Availability,Other
Technical Impact: Alter Execution Logic; DoS: Crash, Exit, or Restart; DoS: Resource Consumption (CPU)
If the overflow/wraparound occurs in a loop index variable, this could cause the loop to terminate at the wrong time - too early, too late, or not at all (i.e., infinite loops). With too many iterations, some loops could consume too many resources such as memory, file handles, etc., possibly leading to a crash or other DoS.
Access Control
Technical Impact: Bypass Protection Mechanism
If integer values are used in security-critical decisions, such as calculating quotas or allocation limits, integer overflows can be used to cause an incorrect security decision.
Access Control
Technical Impact: Bypass Protection Mechanism; DoS: Crash, Exit, or Restart
If integer values are used in time-based, security-critical decisions, such as calculating expiration times or determining whether an event occurs within a specific time or date range, to cause an incorrect security decision. The consequences could even include "self-DoS" if the overflow produces a time value that is not accounted for in protection mechanism logic [REF-1570].
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.