high CVSS 8.8 EPSS 0.32%

CVE-2026-6475·PostgreSQL vulnerability

Symlink following in PostgreSQL pg_basebackup plain format and in pg_rewind allows an origin superuser to overwrite local files, e.g. /var/lib/postgres/.bashrc, that hijack the operating system account. It will remain the case that starting the server after these commands implicitly trusts the origin superuser, due to features like shared_preload_libraries. Hence, the attack has practical implications only if one takes relevant action between these commands and server start, like moving the files to a different VM or snapshotting the VM. Versions before PostgreSQL 18.4, 17.10, 16.14, 15.18, and 14.23 are affected.

Severity
high
Software
PostgreSQL
Fixed in
18.4
Published

How likely is exploitation

FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.32% — higher than 24% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.

Read the two together. CVE-2026-6475 scores 8.8 on CVSS, so a successful attack would be serious — but at 0.32%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.

Affected versions

From: 18.0

Until: 18.4

Fixed in: 18.4

How to fix this CVE

Upgrade PostgreSQL to version 18.4 or later to prevent symlink-based file overwrites during pg_basebackup and pg_rewind operations. This vulnerability allows superusers from the origin server to hijack the local operating system account by writing to sensitive files like shell configuration scripts. Implement the update as soon as possible, especially if your PostgreSQL instance is accessible to untrusted superusers or if backups are restored in shared environments.

sudo dnf update postgresql-server postgresql-client

Defensia detects this vulnerability

How to check if you are affected

  1. Check your installed PostgreSQL version: psql --version or sudo -u postgres psql -c 'SELECT version();'
  2. Identify if pg_basebackup or pg_rewind are used in your backup strategy: grep -r 'pg_basebackup\|pg_rewind' /etc/cron* /var/spool/cron/ /opt/ 2>/dev/null
  3. Review PostgreSQL server logs for symlink-related errors or suspicious file modifications: grep -i 'symlink\|permission denied' /var/log/postgresql/*.log
  4. After patching, verify the new version is running: sudo systemctl restart postgresql && psql --version

FAQ

What is CVE-2026-6475?

A symlink-following vulnerability in PostgreSQL's pg_basebackup (plain format) and pg_rewind tools that allows a superuser on the origin server to write arbitrary files to the target system, potentially compromising the operating system account that runs PostgreSQL through shell initialization scripts or other sensitive configuration files.

Is CVE-2026-6475 being actively exploited?

No, CVE-2026-6475 is not currently listed on the CISA Known Exploited Vulnerabilities catalog, and no public exploits have been disclosed. However, the attack requires coordination between backup/rewind operations and server startup, making it a targeted risk rather than a mass exploitation threat.

What versions of PostgreSQL are affected by CVE-2026-6475?

PostgreSQL versions 18.0 through 18.3, 17.0 through 17.9, 16.0 through 16.13, 15.0 through 15.17, and 14.0 through 14.22 are vulnerable. Fixed versions are 18.4, 17.10, 16.14, 15.18, and 14.23 or later.

How do I check if my server is vulnerable to CVE-2026-6475?

Run 'sudo -u postgres psql -c "SELECT version();"' and compare the version number against the affected ranges above. If your version is below 18.4 (for v18), 17.10 (for v17), etc., your server is vulnerable.

Does Defensia detect CVE-2026-6475?

Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PostgreSQL is installed on a monitored server, CVE-2026-6475 will appear in your dashboard with remediation steps.

Related PostgreSQL CVEs

CVE-2026-15742CVSS 8.8Integer wraparound in PostgreSQL fuzzystrmatch allows a user to direct writes to a huge range of addresses, executing arbitrary code as the operating system user running the database, via extreme inputs to SQL function levenshtein() or levenshtein_less_equal(). Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.
CVE-2026-14670CVSS 8.8Heap buffer overflow in PostgreSQL plperl return of a tied hash allows the function owner to execute arbitrary code as the operating system user running the database, via a crafted function body. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.
CVE-2026-14669CVSS 8.8Heap buffer overflow in PostgreSQL to_char(timestamptz) allows the party choosing the timezone to execute arbitrary code as the operating system user running the database, via a long POSIX timezone abbreviation. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.
CVE-2026-14671CVSS 8.8Type confusion in PostgreSQL module "refint" allows an object creator to execute arbitrary code as the operating system user running the database. The fix for this emerged as a non-security bug report, and the fix appear in the git repository with subject "refint: Remove plan cache.", without a CVE number. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.
CVE-2026-14664CVSS 8.8Heap buffer overflow in PostgreSQL regexp allows the query author to execute arbitrary code as the operating system user running the database, via text that would not pass encoding validation. This shares heritage with CVE-2026-2006, but this case involved unanticipated data growth when round-tripped through pg_wchar. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.

References

Track CVEs across your fleet automatically

Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-6475. Free for 1 server.

Get started free