
Non-destructive PostgreSQL vulnerability checker for CVE-2026-6471. Audits server version and REPLICATION privileges to identify exposure to logical decoding authorization flaw, with remediation guidance.
PostGREShell π’οΈ
A defensive, non-destructive vulnerability checker for CVE-2026-6471
CVE-2026-6471 is a PostgreSQL authorization vulnerability involving the logical decoding subsystem.
The vulnerability can allow a PostgreSQL role possessing the REPLICATION privilege, but lacking superuser privileges, to cause the PostgreSQL server to load an attacker-controlled library accessible to the PostgreSQL operating-system account.
Successful exploitation can result in arbitrary code execution with the privileges of the PostgreSQL server process.
This repository provides a safe detection PoC designed for authorized security assessments.
β οΈ No malicious shared library is loaded and no operating-system command is executed by the checker.
| Property | Value |
|---|---|
| CVE | CVE-2026-6471 |
| Product | PostgreSQL |
| Component | Logical Decoding |
| CWE | CWE-862 β Missing Authorization |
| CVSS v3.1 | 7.2 High |
| Attack Vector | Network |
| Attack Complexity | Low |
| Privileges Required | High |
| User Interaction | None |
| Confidentiality | High |
| Integrity | High |
| Availability | High |
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Under the vulnerable conditions, an attacker who already possesses a PostgreSQL account with the required replication capability may potentially cross the database-to-operating-system privilege boundary.
ββββββββββββββββββββββββ
β PostgreSQL User β
β REPLICATION = YES β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Logical Decoding β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Missing Authorizationβ
β Validation β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Library Loading β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β PostgreSQL OS User β
ββββββββββββββββββββββββ
The actual impact depends heavily on the privileges and filesystem permissions of the PostgreSQL operating-system account.
The PostgreSQL project's security advisory identifies the following affected branches:
| Branch | Affected | Fixed |
|---|---|---|
| PostgreSQL 14 | < 14.24 | 14.24 |
| PostgreSQL 15 | < 15.19 | 15.19 |
| PostgreSQL 16 | < 16.15 | 16.15 |
| PostgreSQL 17 | < 17.11 | 17.11 |
| PostgreSQL 18 | < 18.6 | 18.6 |
Upgrade to the latest security release available for your PostgreSQL branch.
This project intentionally performs non-destructive checks only.
The checker should verify:
REPLICATIONSELECT
version() AS postgres_version,
current_user AS current_user,
rolsuper AS is_superuser,
rolreplication AS has_replication
FROM pg_roles
WHERE rolname = current_user;
Example output:
postgres_version : PostgreSQL 17.x
current_user : security_audit
is_superuser : f
has_replication : t
A vulnerable version combined with REPLICATION privileges should be treated as requiring remediation.
The PoC follows this workflow:
βββββββββββββββββ
β PostgreSQL β
β Connection β
βββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ
β Get Server β
β Version β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Check Current β
β Role β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Check β
β REPLICATION β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Compare Against β
β Fixed Releases β
ββββββββββ¬βββββββββ
β
βββββββββ΄βββββββββ
βΌ βΌ
Potentially Not
Vulnerable Affected
β Load an attacker-controlled .so
β Execute arbitrary SQL payloads
β Execute operating-system commands
β Spawn a reverse shell
β Modify PostgreSQL configuration
β Modify filesystem contents
β Create persistence
β Exploit production systems
This makes the checker suitable for controlled vulnerability assessment and inventory workflows.
Clone the repository:
git clone https://github.com/<YOUR-USERNAME>/CVE-2026-6471.git
cd CVE-2026-6471
Install the required Python dependency:
python3 -m pip install psycopg2-binary
Run the checker:
python3 CVE-2026-6471.py
Example:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CVE-2026-6471 SAFE CHECK β
β PostgreSQL Logical Decoding Audit β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[+] Connecting to PostgreSQL...
[+] Server version : PostgreSQL 17.x
[+] Current role : security_audit
[+] Superuser : False
[+] Replication : True
[!] PostgreSQL version requires security update
[!] REPLICATION privilege detected
[!] POTENTIALLY VULNERABLE
[!] Upgrade PostgreSQL to a fixed release.
Administrators can inspect replication-enabled roles with: