/

CVE-2026-65711

Severity:

HIGH RISK

(7.2)

OS Command Injection (CWE-78) in sysPass Backup Path

CVE-2026-65711

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(7.2)

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

sysPass through version 3.2.11 contains an OS command injection flaw in its backup feature that lets authenticated administrators run arbitrary commands as the web server user.

By configuring a crafted backup path, an attacker can inject shell syntax into the tar command built by FileBackupService, causing the injected commands to execute on every backup trigger.

Affected context

This vulnerability occurs in sysPass instances where the backup functionality is enabled and administrators can configure the siteBackupPath setting. The FileBackupService constructs a tar shell command via direct string concatenation and passes it to exec() without properly sanitizing or escaping the path segment. Under these conditions, any shell metacharacters embedded in the backup path can be interpreted by the underlying shell, turning configuration data into executable commands whenever a backup is started.

Exploit preconditions

  • Attack surface: Application backup configuration and backup execution endpoint or workflow.
  • Required access: Authenticated administrator-level access to modify the siteBackupPath setting, or equivalent privilege to influence backup configuration.
  • Trigger point: Initiation of the backup process (manual backup trigger, scheduled backup job, or any code path that invokes FileBackupService).
  • Why exploitation is possible: The backup path value is interpolated directly into a shell command string without using escapeshellarg() or equivalent safeguards, and the command is executed via exec(), allowing shell metacharacters to alter command behavior and run arbitrary OS commands.

Why this happens

The underlying bug is a classic OS command injection pattern: user-configurable input is concatenated into a shell command and executed without strict validation or safe escaping. In sysPass, FileBackupService builds a tar command string by inserting the configured siteBackupPath directly into the command line, then hands it to exec(). Because this input is not constrained to a benign filename/path format and is interpreted by a shell, attackers can inject additional commands using shell metacharacters. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where application logic fails to neutralize or avoid special characters before command execution.

Potential impact

  • Arbitrary command execution as the web server process user.
  • Reading or exfiltrating sensitive data accessible to the application.
  • Modifying or deleting application data and backup archives.
  • Installing backdoors or additional malicious tooling on the server.
  • Using the compromised server as a pivot for further internal network attacks.

General mitigation guidance

Effective mitigation focuses on removing or strictly constraining the use of shell commands built from dynamic input. Common defensive patterns include:

  • Avoiding shell-based command construction for backups and using library APIs or safe process invocation mechanisms that accept structured arguments rather than free-form command strings.
  • Treating all configuration values, including administrator-supplied paths, as untrusted and enforcing strict validation (e.g., allowing only expected path formats without shell metacharacters).
  • Applying robust escaping or argument-quoting routines when invoking external tools, ensuring user-controlled data is passed as individual arguments instead of being embedded in a full shell command line.
  • Running the web server and application components under least-privilege accounts, and limiting file system and OS-level privileges to minimize the impact if command execution occurs.
  • Designing backup routines so that high-risk operations (like external tool invocation) are centralized and scrutinized, reducing opportunities for subtle injection via configuration options.

How teams detect issues like this

Detection typically involves a combination of code-level and operational checks:

  • Static analysis rules that flag uses of exec(), shell_exec(), system(), or similar functions when they are fed concatenated strings with user- or configuration-controlled data.
  • Secure code review practices that focus on backup and maintenance scripts, looking for command construction patterns using configuration values such as paths, filenames, or options without clear validation or escaping.
  • Application security testing that attempts to inject simple shell metacharacters into configurable paths and observes whether backup or maintenance tasks behave unexpectedly.
  • Policy-based enforcement in CI/CD pipelines that restrict or require justification for shell command usage, coupled with automated tooling to identify and highlight high-risk patterns.

Sources

SourceLink
gist.github.comgist.github.com/sermikr0/16bcbc799dc33d39d5714db9bbcbdb77
vulncheck.comvulncheck.com/advisories/syspass-authenticated-os-command-injection-via-backup-path

Frequently asked

questions

Exploitation is limited to contexts where an attacker has administrator-level access to sysPass and can modify backup configuration. Within that scope, however, the ability to run arbitrary commands as the web server user can significantly impact the host system and data.

The attacker typically needs authenticated administrative access to the sysPass instance or equivalent capability to change the siteBackupPath setting and trigger backups. Lower-privileged users generally cannot reach the vulnerable configuration.

The safest fix pattern is to eliminate shell-based command composition with dynamic input entirely and replace it with library calls or safe process execution that treats configuration values as arguments, not as part of a shell command string. Where external commands are unavoidable, strict validation and robust escaping must be applied to all user-controlled data.

Future prevention relies on adopting secure patterns for interacting with the OS: avoid invoking shells with concatenated strings, enforce strong validation on all configuration inputs, include checks for command execution APIs in code review, and use static analysis or security tooling that systematically flags injection-prone command building patterns.

Find out what's already
exploitable in your codebase.