CVE-2024-1713
📋 TL;DR
This vulnerability in plv8 3.2.1 allows users with database object creation privileges to cause deferred triggers to execute with Superuser privileges during autovacuum processes. This affects PostgreSQL databases with plv8 extension installed where users can create objects. The vulnerability enables privilege escalation from regular database users to Superuser.
💻 Affected Systems
- plv8 PostgreSQL extension
📦 What is this software?
Plv8 by Plv8
⚠️ Risk & Real-World Impact
Worst Case
Complete database compromise with Superuser access, allowing data theft, modification, or destruction, and potential lateral movement to other systems.
Likely Case
Privilege escalation leading to unauthorized data access, modification of database objects, and potential persistence mechanisms.
If Mitigated
Limited impact if proper access controls restrict object creation to trusted users only.
🎯 Exploit Status
Exploitation requires database access and object creation privileges. Proof of concept available in security advisory.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: plv8 version 3.2.2 or later
Vendor Advisory: https://github.com/google/security-research/security/advisories/GHSA-r7m9-grw7-vcc4
Restart Required: Yes
Instructions:
1. Update plv8 extension to version 3.2.2 or later. 2. Restart PostgreSQL service. 3. Verify the updated version is active.
🔧 Temporary Workarounds
Restrict object creation privileges
allLimit CREATE privilege on databases to trusted administrators only.
REVOKE CREATE ON DATABASE database_name FROM username;
Disable plv8 extension
allRemove or disable plv8 extension if not required.
DROP EXTENSION IF EXISTS plv8;
🧯 If You Can't Patch
- Implement strict access controls to limit object creation to essential administrators only.
- Monitor database activity for unusual trigger creation or autovacuum-related privilege escalations.
🔍 How to Verify
Check if Vulnerable:
Check plv8 version: SELECT * FROM pg_available_extensions WHERE name = 'plv8';
Check Version:
SELECT extversion FROM pg_extension WHERE extname = 'plv8';
Verify Fix Applied:
Verify plv8 version is 3.2.2 or later: SELECT extversion FROM pg_extension WHERE extname = 'plv8';
📡 Detection & Monitoring
Log Indicators:
- Unusual trigger creation events
- Autovacuum processes with elevated privileges
- Failed privilege escalation attempts
Network Indicators:
- Unusual database connection patterns from non-admin users
SIEM Query:
source="postgresql" AND (event="CREATE TRIGGER" OR event="autovacuum") AND user!="postgres"