CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-14669

CVE-2026-14669: PostgreSQL to_char() Timezone Abbreviation Heap-Based Buffer Overflow

Alon Barad
Alon Barad
Software Engineer

Aug 24, 2026·6 min read·171 visits

Executive Summary (TL;DR)

An authenticated PostgreSQL user can trigger a heap-based buffer overflow in the to_char() formatting subsystem by using a maliciously long POSIX timezone abbreviation, leading to arbitrary code execution as the 'postgres' user.

CVE-2026-14669 is a critical heap-based buffer overflow vulnerability in PostgreSQL's date/time formatting function to_char(timestamptz). The flaw arises from unsafe copying of user-controlled timezone abbreviations into a fixed-size internal buffer. An authenticated database user can trigger this issue by setting a long POSIX timezone abbreviation containing custom formatting, allowing them to overwrite adjacent heap structures and hijack execution control to achieve remote code execution (RCE) with the privileges of the 'postgres' operating system user.

Vulnerability Overview

CVE-2026-14669 represents a significant security defect in the core date and time formatting module of the PostgreSQL database server. The vulnerability is triggered during the execution of the to_char(timestamptz) formatting function. It occurs when handling custom user-supplied timezone configurations that exceed standard buffer expectations.

PostgreSQL allows active database sessions to declare custom timezone environment settings. Under the POSIX timezone specification, arbitrary alphanumeric strings enclosed within angle brackets are accepted as valid timezone abbreviations. When a user queries to_char with timezone-formatting nodes, the engine tries to process these abbreviations dynamically.

Because this operation runs in the memory space of the active backend database worker, the heap-based buffer overflow exposes critical process structures to corruption. The attack surface is available to any database user authorized to log in and run standard queries. Successful exploitation yields unauthenticated system-level code execution capabilities for the underlying database hosting environment.

Root Cause Analysis

The underlying flaw resides in DCH_to_char within src/backend/utils/adt/formatting.c, which governs format conversions for timestamps. During execution, PostgreSQL parses format descriptors and allocates memory on the heap for the formatted output string. The buffer allocation size for each character of the formatting layout relies on a fixed multiplier.

The global configuration defines DCH_MAX_ITEM_SIZ as 12 bytes per formatting token. Consequently, the timezone tokens TZ and tz receive an allocation limit of exactly 24 bytes in the output array. The system, however, calls the function tmtcTzn(in) to retrieve the actual string of the current session timezone, which is fully controlled by the database client.

Historically, the formatting engine made no check on the string length returned by tmtcTzn(in) relative to the pre-calculated node allocation bounds. The function proceeded to write the retrieved abbreviation using the standard, unbounded strcpy utility. When the custom timezone abbreviation exceeds 24 characters, the memory copy overruns the allocated heap slot, corrupting adjacent chunk structures and heap pointers.

Code-Level Analysis of the Defect and Patch

An analysis of the vulnerable source code in formatting.c highlights the omission of bounds validation during string operations. The vulnerable path maps directly to the formatting cases DCH_TZ and DCH_tz in the engine.

/* Vulnerable code implementation */
case DCH_TZ:
    INVALID_FOR_INTERVAL;
    if (tmtcTzn(in))
    {
        /* Convert to lowercase and copy without validation */
        char       *p = asc_tolower_z(tmtcTzn(in));
 
        strcpy(s, p); // Unbounded copy onto heap-allocated pointer 's'
        pfree(p);
        s += strlen(s);
    }
    break;

The fix, applied in commit 3d724bf4fde67a2931733a5143b7d6c12b23990c, introduces a strict length check. The timezone abbreviation length is validated against the calculated product of the format node length (n->key->len) and the DCH_MAX_ITEM_SIZ constant. If the incoming string length exceeds this boundary, execution halts instantly.

/* Patched code implementation */
case DCH_TZ:
    INVALID_FOR_INTERVAL;
    if (tmtcTzn(in))
    { 
        /* ASCII-only downcasing with safe size checks */
        char       *p = asc_tolower_z(tmtcTzn(in));
 
        if (strlen(p) <= n->key->len * DCH_MAX_ITEM_SIZ)
            strcpy(s, p);
        else
            ereport(ERROR,
                    (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
                     errmsg("time zone format value too long")));
        pfree(p);
        s += strlen(s);
    }
    break;

This safe comparison prevents any unbounded write condition. If an overlength abbreviation is present in the session context, the engine raises an ERRCODE_DATETIME_VALUE_OUT_OF_RANGE error, avoiding any memory corruption and safely aborting the SQL command transaction.

Exploit Chain Analysis

Security research demonstrates that CVE-2026-14669 can be reliably weaponized over standard SQL connections to bypass ASLR. The exploit path utilizes standard PostgreSQL wire protocol commands and is executed in four sequential stages.

In the first stage, the client configures the session to use SQL_ASCII encoding and sets a custom timezone with an abbreviation length of 43 bytes. By initiating a binary-format COPY operation against adjacent to_char outputs, the attacker corrupts the varlena length header of the second column on the heap. When the server processes the database payload, it transmits a large block of out-of-bounds heap memory back to the client, leaking catalog pointers that expose the database base executable address (PIE base).

-- Corrupt adjacent varlena header to disclose server memory addresses
SET TIME ZONE '<AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\x04\x01\x01>-10';
COPY (SELECT to_char(now(), 'TZ'), to_char(now(), 'TZ')) TO STDOUT (FORMAT binary);

In the second stage, the attacker forces an invalid free error using a combined formatting sequence to_char(now(), 'TZtz'). The glibc allocator's diagnostic error message returns a raw pointer location on the heap, allowing the client to map the memory layout. The third stage uses SQL operations to place a forged MemoryContextCallback structure into heap memory, setting its execution handler to system and its argument pointer to the target shell command.

In the fourth and final stage, the query execution closes. This clean-up triggers PostgreSQL's internal garbage collection function MemoryContextReset(). The routine parses the forged memory structure, following the corrupt callback pointers, and executes the specified shell command. The execution runs under the server process privileges, completing the compromise.

Impact Assessment

The impact of successful exploitation is critical, compromising the target system's confidentiality, integrity, and availability. Attackers gain arbitrary code execution capabilities at the operating system level, inheriting the security context of the postgres server daemon.

With command execution established, the attacker can access, modify, or delete any data managed by the database server. They can also read sensitive configurations, inspect system files, and write backdoors. This enables potential lateral movement across internal network segments that interface with the database server.

In shared hosting, containerized, or cloud environments, this heap overflow acts as a direct container escape vector. Even users with restricted schema read access can escalate their privileges to host-level command execution, bypassing typical SQL authorization boundaries entirely.

Remediation and Mitigation

The primary remediation strategy is the immediate application of official patches released by the PostgreSQL development group. Systems should be upgraded to the corrected versions across the supported branches: 18.5+, 17.11+, 16.15+, 15.19+, or 14.24+.

For systems where binary updates cannot be immediately deployed, administrators can apply defensive monitoring configurations. Sessions should be continuously audited for long or complex timezone settings. Security teams should deploy logging rules to track unusual queries matching custom timezone expressions or unexpected database allocator errors.

Database access should follow the principle of least privilege. Minimize client access to sensitive database servers, deploy network-level access control lists, and segment the database layer from public internet interfaces to reduce overall exploit exposure.

Official Patches

PostgreSQL Global Development GroupUpstream security commit implementing validation checks for timezone abbreviation lengths in formatting.c

Fix Analysis (1)

Technical Appendix

CVSS Score
8.8/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Probability
0.61%
Top 54% most exploited

Affected Systems

PostgreSQL Database Server

Affected Versions Detail

Product
Affected Versions
Fixed Version
PostgreSQL
PostgreSQL Global Development Group
>= 18.0, < 18.518.5
PostgreSQL
PostgreSQL Global Development Group
>= 17.0, < 17.1117.11
PostgreSQL
PostgreSQL Global Development Group
>= 16.0, < 16.1516.15
PostgreSQL
PostgreSQL Global Development Group
>= 15.0, < 15.1915.19
PostgreSQL
PostgreSQL Global Development Group
>= 14.0, < 14.2414.24
AttributeDetail
CWE IDCWE-122
Attack VectorNetwork
CVSS Score8.8
EPSS Score0.00609
ImpactRemote Code Execution
Exploit Statuspoc
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1203Exploitation for Client Execution
Execution
T1211Exploitation for Defense Evasion
Defense Evasion
CWE-122
Heap-based Buffer Overflow

The software performs an operation on a memory buffer allocated on the heap, but it writes more data than the buffer can accommodate, corrupting adjacent memory space.

Known Exploits & Detection

GitHubFunctional Python exploitation script leveraging dynamic heap layout modification to bypass ASLR and gain shell access.

Vulnerability Timeline

Vulnerability patched in upstream master and backpatched to active release branches by Tom Lane
2026-08-10
PostgreSQL Global Development Group coordinates releases containing the security updates
2026-08-13
Security researchers publish technical reports explaining the execution flow hijacking vector
2026-08-13
Public functional proof-of-concept python script is released
2026-08-18

References & Sources

  • [1]PostgreSQL Security Advisory - CVE-2026-14669
  • [2]PostgreSQL Official Releases Advisory
  • [3]PostgreSQL Upstream Commit Patch
  • [4]CVE-2026-14669 Authority Record
  • [5]V12 Security Technical PoC Repository
  • [6]Medium - From a 25-byte Buffer to Control Flow Hijack

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•3 minutes ago•CVE-2026-33050
8.8

CVE-2026-33050: OS Command Injection in GeoNode Vector Upload Handler

An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.

Alon Barad
Alon Barad
0 views•9 min read
•about 1 hour ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 2 hours ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.

Amit Schendel
Amit Schendel
4 views•9 min read
•about 3 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.

Amit Schendel
Amit Schendel
3 views•11 min read
•about 4 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
3 views•10 min read
•about 5 hours ago•GHSA-47W9-6R3F-938G
9.9

GHSA-47w9-6r3f-938g: Authorization Bypass and Host Root Command Execution in Canonical LXD and Incus

A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.

Alon Barad
Alon Barad
4 views•11 min read