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·3 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

•2 days ago•CVE-2026-63462
7.5

CVE-2026-63462: Unauthenticated Stack Overflow Denial of Service in Unleash Server

An unauthenticated remote denial of service vulnerability exists in the Unleash feature management platform. By submitting a crafted JSON payload containing deeply nested structures to an OpenAPI-validated endpoint, an attacker can trigger uncontrolled recursion within the error formatting module. This leads to a call-stack exhaustion (RangeError: Maximum call stack size exceeded) inside the Node.js runtime, causing the service to crash immediately without recovery.

Alon Barad
Alon Barad
11 views•6 min read
•2 days ago•CVE-2026-63004
5.5

CVE-2026-63004: Server-Side Request Forgery in Unleash Addon and Integration Subsystem

CVE-2026-63004 is a server-side request forgery (SSRF) vulnerability in the Unleash feature management platform. Authenticated administrators with CREATE_ADDON or UPDATE_ADDON privileges can exploit this vulnerability to initiate requests to loopback addresses, private networks, and cloud metadata endpoints, potentially leading to information disclosure and credential extraction.

Amit Schendel
Amit Schendel
8 views•8 min read
•2 days ago•CVE-2026-63466
4.1

CVE-2026-63466: Process-Wide Security Degradation via Global Module Mutation in Unleash

Prior to version 8.0.3, Unleash's Markdown event formatter directly mutated the global template-escaping function of the shared mustache Node.js module, resulting in a process-wide security degradation where HTML/Markdown escaping was permanently disabled for the application lifetime.

Alon Barad
Alon Barad
3 views•6 min read
•2 days ago•CVE-2026-76904
9.8

CVE-2026-76904: Unauthenticated SQL Injection in GeoTools PostGIS DataStore Component

A critical SQL injection vulnerability exists in the GeoTools open-source Java library. This vulnerability is situated within the post-processing phase of OGC Filter conversion inside the PostGIS DataStore module. Specifically, the `jsonArrayContains` function does not validate or sanitize its arguments before constructing PostgreSQL SQL/JSON path evaluation queries. An unauthenticated remote attacker can exploit this weakness by submitting crafted filters via standard OGC services like WFS or WMS to execute arbitrary SQL commands on the underlying database system.

Alon Barad
Alon Barad
14 views•5 min read
•2 days ago•CVE-2026-61824
8.2

CVE-2026-61824: High-Severity Cross-Site Scripting (XSS) via Unsanitized Site Extractors in Defuddle

CVE-2026-61824 is a high-severity Cross-Site Scripting (XSS) vulnerability in kepano/defuddle before version 0.19.1. Custom site extractors for platforms such as X/Twitter, Substack, and YouTube constructed HTML representations via template string interpolation without output escaping. This allowed malicious pages to bypass standard parser sanitization routines and execute arbitrary JavaScript.

Amit Schendel
Amit Schendel
7 views•7 min read
•2 days ago•CVE-2026-63421
7.5

CVE-2026-63421: Query Limit Bypass via Negative Integer Input in KeystoneJS core resolvers

A high-severity vulnerability exists in KeystoneJS, a popular Node.js CMS and GraphQL framework, where the query resolution engine fails to validate signed negative integers within the pagination subsystem. Unauthenticated remote attackers can leverage this flaw to bypass the 'graphql.maxTake' safety boundary. By sending large negative values in the 'take' query parameter, the underlying Prisma ORM interprets the value as an instruction to fetch rows from the end of the collection, allowing malicious actors to bypass pagination limits, trigger database resource exhaustion, and execute application-level Denial of Service (DoS) attacks.

Alon Barad
Alon Barad
8 views•6 min read