Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-14669 — Proof-of-concept exploit for CVE-2026-14669, a PostgreSQL to_char() timezone abbreviation heap buffer overflow enabling RCE through information leak and ROP chain; includes Docker lab and automated PoC. | Kitploit
Tools/GitHubGitHub/hackspeak/cve-2026-14669
Vulnerability AnalysisExploitationPenetration TestingPayload DevelopmentDatabase SecurityBinary ExploitationLabs & Practice
GitHubhackspeak/cve-2026-14669

CVE-2026-14669

Proof-of-concept exploit for CVE-2026-14669, a PostgreSQL to_char() timezone abbreviation heap buffer overflow enabling RCE through information leak and ROP chain; includes Docker lab and automated PoC.

View Repository
31252 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

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

PostgreSQL to_char() function has a heap buffer overflow vulnerability when handling timezone formatting. By setting an overly long POSIX timezone abbreviation, an attacker can trigger an out-of-bounds write to a fixed 25-byte buffer, and combine it with information leakage and an ROP chain to achieve remote code execution.

Vulnerability Information

  • CVE ID: CVE-2026-14669
  • CVSS Score: 8.8 (High)
  • Vulnerability Type: Heap buffer overflow → Remote code execution
  • Affected Component: PostgreSQL to_char(timestamptz) function
  • Discovered by: V12 Security

Affected Versions

PostgreSQL SeriesAffected Range
18.x18.0 – 18.5
17.x17.0 – 17.10
16.x16.0 – 16.14
15.x15.0 – 15.18
14.x14.0 – 14.23

Fixed Versions

  • PostgreSQL 18.6+
  • PostgreSQL 17.11+
  • PostgreSQL 16.15+
  • PostgreSQL 15.19+
  • PostgreSQL 14.24+

Vulnerability Details

The DCH_TZ / DCH_tz handling path in formatting.c uses a 25-byte fixed stack buffer to store the timezone abbreviation, but there is no check on input length. When the timezone abbreviation exceeds 24 bytes, strcpy() writes out of bounds into heap memory.

Trigger path:

SET TIME ZONE '<超长缩写>+00';
SELECT to_char(now()::timestamptz, 'TZ');
  ↓
DCH_to_char() → DCH_from_char_action()
  ↓
strcpy(buf, tmtcTzn(...))  ← 堆溢出

Exploitation Requirements

  • Any valid database authentication credentials (minimum privilege at USAGE level)
  • TCP reachable database port
  • Ability to execute SQL statements

Complete Exploitation Chain

V12 Security's PoC consists of three phases:

Phase 1: Information Leak

Use the heap overflow to corrupt adjacent heap objects and leak the PIE base and heap pointers to defeat ASLR.

Phase 2: ROP Chain Construction

Use large objects or bytea fields to lay out the ROP gadget chain on the heap.

Phase 3: Control Flow Hijacking

The second overflow overwrites a function pointer on the heap, jumping to the ROP chain to execute arbitrary commands (as the postgres user).

PoC Files

  • poc.py - Full exploit script (210 lines, targeting PostgreSQL 19beta1)
  • requirements.txt - Python dependencies (psycopg, pwntools)
  • docker-compose.yml - Vulnerability test environment

Usage

1. Start the Test Environment

docker-compose up -d

Wait for the container to finish starting (health check passed):

docker logs pg-tzlab

2. Install Dependencies

pip install -r requirements.txt

3. Run the PoC

python3 poc.py

By default it connects to 127.0.0.1:55432 with username postgres and password postgres.

After successful exploitation, you can see the command execution output in the container logs:

docker logs pg-tzlab | grep PWNED

4. Customize Configuration

Edit the constants in poc.py:

  • HOST, PORT - target address
  • DEFAULT_COMMAND - command to execute

⚠️ Important: This PoC hardcodes the offsets of a specific build (postgres:19beta1 Docker image sha256:a6bdd01...). Other versions will require relocating gadgets.

Mitigations

  1. Upgrade immediately to a fixed version (most effective)
  2. Network isolation: restrict database ports to trusted hosts only
  3. Account minimization: remove unnecessary accounts and enforce strong passwords
  4. Monitoring/alerting: monitor overly long SET TIME ZONE statements (> 50 characters)

Disclaimer

⚠️ This PoC is for security research, vulnerability validation, and defensive testing only.

  • Run it in a disposable test environment (Docker lab)
  • Do not use against unauthorized or production environments
  • Exploitation can cause the target server process to crash or lead to control flow hijacking

By using this PoC, you agree to comply with local laws and regulations and the authorization boundaries of the target system.

References

  • PostgreSQL Official Security Advisory
  • PostgreSQL Release Announcement
  • Upstream Fix Commit
  • V12 Security Technical Analysis
  • Original PoC Repository

Original Author

  • Original PoC: V12 Security team
  • Original repository: https://github.com/v12-security/pocs
  • License: The upstream repository has no LICENSE file; this repository uses the MIT License
  • This repository: Mirror distribution version, preserving the original author's attribution
Download Tool