Skip to content

CVE-2026-21708: PostgreSQL SQL Injection to Remote Code Execution via Backup Viewer Role in Veeam Backup & Replication

HERMES

HERMES THREAT SCORE & ENTERPRISE RISK

Target: Veeam Backup & Replication PostgreSQL Database Backend & Reporting Sinks
Confidence: 99%
99 / 100
CRITICAL

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 20 / 20
Threat Activity 19 / 20
Weaponization 20 / 20
Exposure 19 / 20
Prevalence 19 / 20
Impact 20 / 20
Exploit Maturity 20 / 20
Attack Chain Potential 20 / 20
⚖️ Divergence & Operational Rationale

Hermes Threat Score rates CVE-2026-21708 at 99 (CRITICAL). Because the web and API layers connect to PostgreSQL with administrative superuser privileges, a SQL injection exploitable by a read-only 'Backup Viewer' role instantly breaks database isolation and executes arbitrary operating system commands, facilitating complete takeover of the recovery plane.

🕸️ Connected Knowledge Graph & Provenance

CVE-2026-21708: Veeam Backup & Replication PostgreSQL SQL Injection to RCEVULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTVeeam Backup & Replication
98% VERY_HIGH

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.”

Supporting Verified Evidence:

1. Vulnerability Metadata & Affected Surface

Section titled “1. Vulnerability Metadata & Affected Surface”
ParameterTechnical SpecificationOperational Impact
CVE IdentifierCVE-2026-21708Global tracking identifier
Vendor AdvisoriesVeeam KB4830 (v12) & KB4831 (v13)Unified security update bundle
Affected BuildsVBR 12.x (12.0.0.1402 to < 12.3.2.4465) & 13.x (< 13.0.1.2067)PostgreSQL database deployments
Patched ReleasesVBR Build 12.3.2.4465 & 13.0.1.2067Cumulative emergency release
Vulnerable ComponentDatabase Query DispatcherDynamic SQL generation routines
Required RoleBackup ViewerLowest privileged role in VBR RBAC
Database ConnectionPostgreSQL Superuser (postgres)Unrestricted SQL execution permissions
ImpactRemote Code Execution & Host Sandbox EscapeFull system and backup compromise

2. Technical Root Cause & Sandbox Escape Mechanics

Section titled “2. Technical Root Cause & Sandbox Escape Mechanics”

The vulnerability stems from improper neutralization of input in dynamic SQL construction (CWE-89) combined with excessive database connection privileges.

CVE-2026-21708 SQL Injection to OS RCE Pipeline:
[Authenticated Operator (Backup Viewer Role)]
│
│ 1. Submits crafted filter parameter via REST API / UI:
│ param = "'; COPY (SELECT '') TO PROGRAM 'cmd.exe /c ...'-- "
▼
[Veeam Backend Query Engine]
│
│ 2. Concatenates string directly into dynamic SQL statement
▼
[PostgreSQL Server (TCP 5432)]
│
│ 3. Executes query under 'postgres' Superuser Account
▼
[Database Sandbox Escape (CWE-89)]
│
│ 4. PostgreSQL spawns system shell via 'COPY ... FROM PROGRAM'
▼
[Operating System Command Execution]
└── Executes payload with postgres / LocalSystem privileges

Under standard operational design, an operator assigned the Backup Viewer role is restricted to viewing job status, storage consumption, and historical task logs without permission to modify infrastructure.

However, because the application broker queries the database using a single, high-privileged connection pool authenticating as postgres, any parameter concatenation vulnerability completely bypasses application-level RBAC. By escaping the query context, the attacker issues:

'; CREATE TABLE cmd_exec(output text);
COPY cmd_exec FROM PROGRAM 'powershell -enc <Base64_Payload>';--

Because the PostgreSQL service possesses operating system execution capabilities, the injected COPY ... FROM PROGRAM command runs child processes directly under the database service account on the host.


3. Attack Chain & Ransomware Operationalization

Section titled “3. Attack Chain & Ransomware Operationalization”

In real-world adversary operations, CVE-2026-21708 completely alters the attacker’s risk calculus:

  1. Low-Risk Account Abuse: Adversaries do not need to target highly audited administrator credentials. An audit account, service desk viewer account, or third-party monitoring integration holding Backup Viewer rights is sufficient.
  2. Instant Host Takeover: Within seconds of sending a single HTTP POST request, the attacker obtains an interactive shell on the backup server.
  3. Recovery Plane Destruction: From the host shell, the attacker extracts DPAPI keys, dumps Active Directory domain admin credentials, and issues disk-formatting commands to wipe backup repositories.

title: PostgreSQL Service Spawning Command Shell
id: 7c12f498-8b21-4f12-9912-cve-2026-21708-pgescape
status: production
description: Detects command shells or administrative utilities spawned directly by postgres.exe, indicative of CVE-2026-21708 SQL injection and sandbox escape.
references:
- https://www.veeam.com/kb4830
- https://www.veeam.com/kb4831
author: Hermes Codex DFIR Lab
date: 2026-09-09
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith: '\postgres.exe'
selection_child:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\pwsh.exe'
- '\whoami.exe'
- '\net.exe'
- '\certutil.exe'
condition: selection_parent and selection_child
level: critical
tags:
- attack.execution
- attack.t1059
- attack.initial_access
- attack.t1190
- cve.2026-21708

  1. Apply Hotfix KB4830 / KB4831 Immediately: Update Veeam Backup & Replication 12 to 12.3.2.4465 and VBR 13 to 13.0.1.2067. The patch replaces all dynamic query concatenation with parameterized SQL prepared statements.
  2. Audit & Restrict the Backup Viewer Role: Enumerate all users assigned the Backup Viewer role. Ensure that unnecessary accounts are revoked and that console MFA is enforced across all accounts regardless of privilege tier.
  3. Database Network Isolation: Ensure the PostgreSQL service on TCP port 5432 listens exclusively on 127.0.0.1 and is completely inaccessible from external network interfaces.

Section titled “6. Master Series Navigation & Related Intelligence”