/

CVE-2026-24129

Severity:

HIGH RISK

(8.0)

OS Command Injection in Runtipi BackupManager

CVE-2026-24129

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution on Host Server (via Authenticated Web Interface)

Severity:

HIGH RISK

(8.0)

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

Runtipi's BackupManager component allows authenticated users to execute arbitrary system commands on the host by injecting shell metacharacters into backup filenames.

Because user-controlled filenames are written directly to the host filesystem and later interpolated into restore commands without sanitization, a crafted backup file name can be used to trigger command execution during the restore process.

Affected context

This vulnerability affects Runtipi deployments (versions 3.7.0 and above, prior to the fix) where:

  • Users can upload backup archives through the web UI or API.
  • The BackupManager stores uploaded files on the host filesystem using the original, user-supplied filename.
  • Restore operations later reference these stored files using shell-invoked commands.

The risk is most pronounced in multi-user or exposed deployments where non-admin or less-trusted authenticated accounts can upload and restore backups.

Exploit preconditions

  • Attack surface: Runtipi backup upload and restore functionality exposed via HTTP(S) (web UI or API).
  • Required access: An authenticated account with permissions to upload backups and trigger restore operations (or influence an operator to restore).
  • Trigger point: Invocation of the backup restore process that uses the stored filename in a shell context.
  • Why exploitation is possible: The BackupManager:
  • Persists user-controlled originalname directly as the filesystem path.
  • Subsequently constructs shell commands or shell-interpreted arguments incorporating this filename without proper quoting, validation, or sanitization.
  • Allows shell metacharacters (e.g., $(), backticks, pipes, redirects) in filenames to be interpreted as part of the OS command during restore.

Why this happens

The underlying flaw is a classic OS Command Injection problem as described by CWE-78. The application treats user input (backup filenames) as data initially, but later reuses it in a context where a command interpreter is involved without enforcing a strict separation between data and executable code.

Concretely:

  • The BackupManager accepts a filename from the client (originalname) and writes files to the host filesystem using this value unmodified.
  • When performing a restore, the implementation likely constructs a shell command (e.g., to extract an archive) by concatenating or interpolating this filename into a command string.
  • Because the application neither validates allowed filename patterns nor reliably quotes or bypasses the shell, special characters in the filename are interpreted by the shell as command syntax.

This pattern aligns with CWE-78: passing unsanitized, user-controlled input into a shell command leads to unintended execution of arbitrary commands.

Potential impact

  • Execution of arbitrary OS commands on the host server with the privileges of the Runtipi process.
  • Reading, modification, or deletion of data stored on the host or accessible mounted volumes.
  • Installation of backdoors, cryptominers, or other persistent malware on the homeserver.
  • Pivoting to other services or containers orchestrated by Runtipi, potentially compromising the broader environment.
  • Disruption of services (e.g., stopping, corrupting, or overwriting application data during malicious "restore" operations).

General mitigation guidance

Effective mitigation centers on eliminating the ability for user input to influence shell interpretation and tightening trust around backup handling:

  • Avoid shell where possible:
  • Prefer direct invocation of archival or restore libraries/APIs (e.g., language-native tar/zip libraries) instead of constructing shell commands.
  • If external binaries must be used, call them via parameterized process execution APIs that do not invoke a shell (e.g., execve/spawn with argument arrays).
  • Enforce strict filename controls:
  • Normalize filenames to a safe, internal format (e.g., UUIDs or timestamp-based names) irrespective of the user-provided originalname.
  • Restrict characters allowed in persisted filenames to a minimal safe set (e.g., alphanumerics, hyphens, underscores, and dots).
  • Strip or reject any input containing shell metacharacters ($, ;, &, |, <, >, backticks, (, ), newline, etc.).
  • Confine backup paths:
  • Ensure all backup files are stored within a dedicated, fixed directory, and avoid constructing paths using unvalidated user input.
  • Use path normalization and checks to prevent directory traversal or references outside the intended storage root.
  • Privilege and isolation:
  • Run Runtipi and its backup processes under a non-privileged account with minimal host permissions.
  • Use container- or OS-level sandboxing to limit the blast radius of a compromised backup restore process.
  • Secure-by-default operational practices:
  • Treat backup upload and restore as sensitive operations, ideally restricted to trusted administrators.
  • Implement least-privilege RBAC around backup functionality, especially in multi-user environments.

How teams detect issues like this

Detection can focus both on code-level patterns and runtime behaviors:

  • Static analysis and code review:
  • Search for uses of shell execution APIs (e.g., exec, spawn with shell=true, system, backtick operators) where arguments include user-controlled values such as filenames or request parameters.
  • Flag any logic that interpolates or concatenates HTTP request fields (including originalname, filename, or path segments) into command strings.
  • Enforce secure coding guidelines that require:
  • Use of non-shell process APIs with argument arrays.
  • Input validation and canonicalization for all filesystem-related parameters.
  • Automated scanning and policy checks:
  • Configure SAST tools to detect CWE-78 patterns, particularly shell-invoking functions fed by HTTP input or request body metadata.
  • Add CI policies that block merges if new shell command construction is introduced without explicit security review.
  • Runtime and log monitoring:
  • Monitor application logs and system audit trails for unusual backup filenames containing shell metacharacters.
  • Alert on restore operations involving suspicious filenames or unexpected command-line arguments.
  • Use host-based intrusion detection to detect anomalous commands executed under the Runtipi service account during backup or restore operations.

Sources

SourceLink
github.comgithub.com/runtipi/runtipi/commit/c3aa948885554a370d374692158a3bfe1cfdc85a
github.comgithub.com/runtipi/runtipi/releases/tag/v4.7.0
github.comgithub.com/runtipi/runtipi/security/advisories/GHSA-vrgf-rcj5-6gv9

Frequently asked

questions

Exploitability is limited to authenticated users who can upload backups and trigger or influence restore operations. In single-user, tightly controlled setups, the risk is essentially self-compromise, but in shared or exposed deployments, a lower-privileged authenticated user could leverage this to gain full command execution on the host.

An attacker needs an account on the Runtipi instance with the ability to upload backup files and either directly trigger a restore or rely on an administrator to restore the crafted backup. No direct shell access is required; exploitation occurs through the application's restore workflow.

The safest fix is to stop passing user-controlled filenames to shell interpreters entirely. Use safe process execution APIs without shell=true, generate internal canonical filenames instead of trusting user-provided names, and strictly validate or normalize any file-related parameters before use.

Adopt a defensive coding standard that:

  • Prohibits shell-based command construction with untrusted input.
  • Requires strict input validation and canonicalization for filenames and paths.
  • Encourages using high-level libraries or parameterized process calls instead of raw shell commands.
  • Enforces security reviews and automated checks for any code that interacts with the filesystem or invokes OS commands, especially in backup, restore, and import/export functionality.
Find out what's already
exploitable in your codebase.