CVE-2026-6475: PostgreSQL Symlink Vulnerability Allows Superuser Hijack
The National Vulnerability Database has detailed CVE-2026-6475, a symlink following vulnerability in PostgreSQL’s pg_basebackup (plain format) and pg_rewind utilities. This flaw allows an originating superuser to overwrite local files, such as /var/lib/postgres/.bashrc, which can lead to the hijacking of the operating system account. This isn’t a direct remote code execution, but a post-exploitation path that can be leveraged.
The attack’s practical implications hinge on specific actions taken between the execution of these commands and the server’s restart. For instance, moving affected files to a different VM or snapshotting the VM between the compromise and server restart would enable the attack. The core issue is that starting the server after these commands implicitly trusts the origin superuser, especially due to features like shared_preload_libraries which can be exploited for privilege escalation.
Versions of PostgreSQL prior to 18.4, 17.10, 16.14, 15.18, and 14.23 are affected. The National Vulnerability Database assigns this a CVSS score of 8.8 (HIGH), underscoring the severity of potential account takeover and subsequent system compromise. Defenders need to understand that this is a trust exploitation scenario, not a zero-day RCE, but it opens a door for a malicious insider or an attacker who has already gained superuser privileges to establish persistence and further compromise the system.
What This Means For You
- If your organization uses PostgreSQL, you need to verify your database versions immediately. Patch any instances running versions prior to 18.4, 17.10, 16.14, 15.18, or 14.23. This isn't just about data integrity; it's about preventing an already compromised superuser from gaining persistent operating system-level control. Audit your `pg_basebackup` and `pg_rewind` usage, and scrutinize any file modifications in `/var/lib/postgres/` or similar paths before server restarts, especially after migration or recovery operations.
Related ATT&CK Techniques
🛡️ Detection Rules
3 rules · 6 SIEM formats3 detection rules auto-generated for this incident, mapped to MITRE ATT&CK. Sigma YAML is free — export to any SIEM format via the Intel Bot.
CVE-2026-6475: PostgreSQL pg_basebackup/pg_rewind Symlink to Bashrc Overwrite
title: CVE-2026-6475: PostgreSQL pg_basebackup/pg_rewind Symlink to Bashrc Overwrite
id: scw-2026-05-14-ai-1
status: experimental
level: critical
description: |
Detects the modification of the .bashrc file within the PostgreSQL data directory, specifically targeting the behavior described in CVE-2026-6475 where pg_basebackup or pg_rewind symlink following can lead to the overwrite of this file, enabling OS account hijacking.
author: SCW Feed Engine (AI-generated)
date: 2026-05-14
references:
- https://shimiscyberworld.com/posts/nvd-CVE-2026-6475/
tags:
- attack.persistence
- attack.t1574.006
logsource:
category: file_event
detection:
selection:
TargetFilename|endswith:
- '.bashrc'
EventType: 'modify'
selection_base:
TargetFilename|contains:
- '/var/lib/postgres/'
condition: selection AND selection_base
falsepositives:
- Legitimate administrative activity
Source: Shimi's Cyber World · License & reuse
Indicators of Compromise
| ID | Type | Indicator |
|---|---|---|
| CVE-2026-6475 | Vulnerability | CVE-2026-6475 |
Source & Attribution
| Source Platform | NVD |
| Channel | National Vulnerability Database |
| Published | May 14, 2026 at 17:16 UTC |
This content was AI-rewritten and enriched by Shimi's Cyber World based on the original source. All intellectual property rights remain with the original author.
Believe this infringes your rights? Submit a takedown request.