/

CVE-2026-26191

Severity:

CRITICAL RISK

(9.8)

Command Injection in Fleet Software Installer Pipeline

CVE-2026-26191

Analyzed

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution on Managed Endpoints

Severity:

CRITICAL RISK

(9.8)

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

A command injection flaw in Fleet's software installer pipeline allows malicious package metadata to be embedded into auto-generated uninstall scripts without proper sanitization.

On affected versions, a crafted software package uploaded to Fleet can cause arbitrary commands to execute as root (macOS/Linux) or SYSTEM (Windows) on managed endpoints when an uninstall is triggered.

Affected context

This vulnerability appears in Fleet deployments that:

  • Use the software management feature to upload and distribute packages (.pkg, .deb, .rpm, .exe, .msi)
  • Automatically generate uninstall scripts from package metadata
  • Deploy and execute these uninstall scripts on managed macOS, Linux, or Windows endpoints

The risk materializes when uploaded package binaries come from sources whose metadata fields are not fully trusted or validated.

Exploit preconditions

  • Attack surface: Fleet server software management interface or API where packages are uploaded.
  • Required access: Ability to upload or register a software package in Fleet (e.g., admin or operator role, compromised admin account, or misconfigured automation).
  • Trigger point: Execution of the auto-generated uninstall script on managed endpoints (e.g., when an admin initiates uninstall or a policy-driven removal occurs).
  • Why exploitation is possible: Metadata extracted from the uploaded package is interpolated into uninstall script commands without adequate sanitization or escaping, permitting attacker-controlled shell syntax to be executed with elevated privileges.

Why this happens

The core issue is improper handling of untrusted input when constructing shell commands in uninstall scripts.

Fleet extracts metadata fields from uploaded package binaries and incorporates them directly into uninstall script templates.

Because these values are not normalized, validated, or safely escaped for the target shell, an attacker can embed shell metacharacters or command sequences in the metadata.

When the uninstall script runs, the shell interprets this crafted content as executable commands, matching CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

Potential impact

  • Remote execution of arbitrary commands as root on macOS and Linux endpoints.
  • Remote execution of arbitrary commands as SYSTEM on Windows endpoints.
  • Installation of additional malware or backdoors across the managed fleet.
  • Exfiltration or destruction of sensitive data stored on endpoints.
  • Lateral movement inside the organization's network from compromised endpoints.
  • Tampering with endpoint configuration, security tooling, or logging.

General mitigation guidance

Effective mitigation focuses on treating package metadata as untrusted input and on hardening script generation:

  • Use strict input validation and canonicalization for all metadata fields before using them in scripts (e.g., length limits, allowed character sets, rejecting unexpected control or shell metacharacters).
  • Properly escape or quote all metadata values when interpolating into shell commands, or avoid direct shell concatenation by passing arguments as safer structured parameters where possible.
  • Prefer non-shell execution mechanisms where feasible (e.g., dedicated APIs, configuration management tools, or language-native process execution with argument arrays).
  • Apply least-privilege principles to uninstall operations, limiting the scope and permissions of the processes that run generated scripts.
  • Establish a review process for auto-generated uninstall scripts, including manual or automated checks before deployment to endpoints.
  • Limit the use of auto-generated scripts to packages from trusted, verified sources and ensure supply chain validation (e.g., signatures, checksums, provenance policies).

How teams detect issues like this

Detection is best approached through both code-level and operational controls:

  • Static analysis: Configure SAST rules to detect string concatenation into shell commands, unsanitized interpolation of external data, and script template code paths that consume metadata-derived values.
  • Code review signals: Flag any logic that:
  • Reads metadata from uploaded binaries and passes it into command strings.
  • Builds uninstall or lifecycle scripts dynamically using user-controlled or externally sourced fields.
  • Runtime monitoring: On endpoints, monitor for uninstall scripts executing unexpected commands or spawning unusual subprocesses, especially under root or SYSTEM accounts.
  • Policy enforcement: Implement CI/CD policies that block changes introducing new shell command templates using unvalidated variables, and require security review for changes to software install/uninstall pipelines.
  • Automated tooling: Use security linters and automated code review systems to surface OS command injection patterns as part of regular development workflows.

Sources

SourceLink
github.comgithub.com/fleetdm/fleet/releases/tag/fleet-v4.81.1
github.comgithub.com/fleetdm/fleet/security/advisories/GHSA-9vcr-g537-3w5v

Frequently asked

questions

Yes. Once a malicious package is uploaded and its uninstall script is deployed, the crafted commands can execute on any managed endpoint where the software is installed and an uninstall is triggered, leading to remote code execution with elevated privileges.

An attacker typically must be able to upload or register a software package in Fleet, which usually requires administrative or operator-level access or compromise of such an account. Misconfigured integrations or automation that accept unverified packages can also expand the effective attack surface.

The key fix is to treat package metadata as untrusted input: validate and normalize all metadata, strictly constrain allowed characters, and ensure safe escaping or non-shell execution when constructing uninstall logic. Avoid building shell commands via direct string concatenation with external data.

Adopt a secure-by-design approach for any feature that generates or runs scripts based on external data: define clear trust boundaries, enforce rigorous input validation and encoding, minimize reliance on shell interpretation, and include security-focused code review and automated checks for command injection patterns in your development workflow.

Find out what's already
exploitable in your codebase.