/

CVE-2026-27965

Severity:

CRITICAL RISK

(9.9)

OS Command Injection in Vitess Backup Restore

CVE-2026-27965

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution in Backup Restore Environment

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Vitess backup restore logic trusted decompressor commands specified in backup manifest files, allowing an attacker with read/write access to the backup storage to inject arbitrary shell commands.

When a manipulated backup is later restored, these commands can execute in the production deployment environment, potentially granting the attacker access to sensitive data and the ability to run further arbitrary operations.

Affected context

This vulnerability affects Vitess deployments where:

  • Backups and manifests are stored in locations such as S3 or similar object storage, and
  • Backup manifest files are treated as trusted configuration input during restore, and
  • Restore operations (vttablet, vtbackup) honor decompression commands embedded in the manifest.

The risk is higher when backup storage is shared across environments, or when multiple systems or users can modify backup objects without strict integrity controls.

Exploit preconditions

  • Attack surface: Backup manifest files stored in remote or local backup storage (e.g., S3 buckets, object storage, shared filesystems).
  • Required access: Ability to read and write backup manifest files in the storage location used by Vitess backups.
  • Trigger point: A restore operation that consumes a crafted backup manifest and executes the decompression command it specifies.
  • Why exploitation is possible: The restore process implicitly trusts decompressor commands read from the manifest and passes them to the shell without sufficient validation or restriction, enabling command injection (CWE-78).

Why this happens

The core issue is that the backup restore logic uses command strings from the backup manifest file as part of shell execution without enforcing a safe, fixed command set.

Instead of treating the manifest data as simple configuration for a predefined decompressor, the implementation allowed arbitrary command tokens to flow from a data file into an OS command execution context.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, where untrusted input influences the construction of shell commands, enabling attackers to inject and execute additional instructions when the backup is restored.

Potential impact

  • Execution of arbitrary commands in the Vitess production environment when a crafted backup is restored
  • Unauthorized access to databases and sensitive information available to the affected Vitess components
  • Establishment of persistence or lateral movement inside the infrastructure hosting Vitess
  • Tampering with restored data or backup integrity, including data corruption or backdooring
  • Use of the affected environment as a pivot for broader supply-chain or infrastructure compromise

General mitigation guidance

Effective mitigation focuses on treating backup metadata as untrusted input and constraining how it can affect command execution:

  • Prefer fixed, hard-coded decompression implementations or a small, vetted whitelist of decompressor commands instead of arbitrary command strings from manifests.
  • Avoid passing manifest values directly to shell interpreters; use parameterized process execution APIs that separate executable paths from arguments.
  • Treat backup storage as a semi-trusted or untrusted boundary: apply integrity controls (e.g., signing, checksums) for manifests and verify them before use.
  • Restrict who can write or modify backup and manifest objects; apply least-privilege IAM policies for S3 or other object storage.
  • Run restore processes (vttablet, vtbackup) with minimal OS privileges and confined execution environments (containers, sandboxes, or restricted service accounts) to limit blast radius if something goes wrong.

How teams detect issues like this

Organizations can use a combination of code-level and operational controls to detect this class of issue:

  • Static analysis: Flag code paths where values parsed from data files (like manifests) are later concatenated into shell commands or passed to command execution APIs (e.g., system, exec, popen).
  • Code review: Look for patterns where configuration or metadata from backup files can alter executable paths, decompressor commands, or shell pipelines without validation or whitelisting.
  • Policy enforcement: Establish secure coding standards that disallow arbitrary shell execution from configuration fields and require explicit whitelists for external tools.
  • Runtime monitoring: Log and monitor the commands invoked during backup and restore operations; alert on unexpected binaries, arguments, or destinations being used in decompression phases.

Sources

SourceLink
github.comgithub.com/vitessio/vitess/commit/4c0173293907af9cb942a6683c465c3f1e9fdb5c
github.comgithub.com/vitessio/vitess/issues/19459
github.comgithub.com/vitessio/vitess/pull/19460
github.comgithub.com/vitessio/vitess/security/advisories/GHSA-8g8j-r87h-p36x

Frequently asked

questions

It can be, if an attacker can obtain read/write access to the backup storage over the network (e.g., misconfigured S3 bucket or compromised account) and a privileged user or system later restores from that manipulated backup.

The attacker needs the ability to modify backup manifest files in the storage location used by Vitess, but does not need direct access to the running Vitess instances or production hosts. The restore process becomes the execution vector.

Constrain decompression to trusted, fixed commands or a small allowlist and ensure that any values read from manifests are treated as data only, not executable command strings. Avoid constructing shell commands from untrusted input altogether.

Design interfaces so that configuration and metadata cannot directly influence shell execution, apply strict validation and whitelisting for external tools, protect and integrity-check backup artifacts, and enforce secure coding patterns through reviews and automated analysis.

Find out what's already
exploitable in your codebase.