/

CVE-2026-35580

Severity:

CRITICAL RISK

(9.1)

OS Command Injection in Emissary GitHub Actions Workflows

CVE-2026-35580

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77

Impact:

Arbitrary Command Execution and Supply-Chain Compromise

Severity:

CRITICAL RISK

(9.1)

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

Emissary's pre-8.39.0 GitHub Actions workflows interpolated user-controlled workflow_dispatch inputs directly into shell commands using ${{ }} expressions.

An attacker with repository write access could inject arbitrary shell commands into these workflows, potentially poisoning the repository and compromising the software supply chain for downstream consumers.

Affected context

This vulnerability occurs in Emissary projects that:

  • Use the bundled GitHub Actions workflows provided prior to version 8.39.0
  • Expose workflow_dispatch or similar inputs that are partially or fully user-defined
  • Construct shell commands by directly interpolating ${{ inputs.* }} or other user-controlled values into run: steps

The risk is most relevant when these workflows are used in automated build, packaging, or release pipelines that are trusted by downstream users or systems.

Exploit preconditions

  • Attack surface: GitHub Actions CI/CD workflows associated with an Emissary repository.
  • Required access: Repository write access (e.g., collaborator, compromised maintainer account, or malicious fork merged to default branch).
  • Trigger point: Execution of a GitHub Actions workflow that:
  • Accepts user-controlled workflow_dispatch inputs (or similar)
  • Embeds those inputs directly in shell commands within run: steps
  • Why exploitation is possible: The workflow interpolates untrusted data into shell commands without quoting, validation, or separation between data and code, allowing crafted input to break out of expected arguments and execute arbitrary commands.

Why this happens

The underlying issue is improper construction of shell commands in GitHub Actions workflows, where user-controlled values are treated as trusted command fragments.

Instead of treating workflow_dispatch inputs as opaque data, the workflows embedded them directly inside run: steps using ${{ }} expression syntax.

This corresponds to CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where shell metacharacters and control operators in user input are not neutralized, enabling attackers to alter command structure and execute arbitrary OS-level commands in the CI environment.

Potential impact

  • Execution of arbitrary shell commands within GitHub Actions runners.
  • Injection of malicious code into the repository (repository poisoning).
  • Unauthorized modification of build artifacts, container images, or release packages.
  • Insertion of backdoors or malware into distributed binaries, libraries, or workflows.
  • Credential theft from CI secrets (tokens, keys, and other sensitive configuration).
  • Downstream supply-chain compromise affecting users who consume generated artifacts.

General mitigation guidance

Effective mitigation focuses on separating user input from command execution and minimizing trust in CI-supplied data:

  • Prefer parameterized invocations of scripts or tools that receive input as arguments or environment variables, not as raw command fragments.
  • Avoid constructing shell commands by concatenating or interpolating ${{ inputs.* }} directly; instead, pass inputs as variables and handle them inside scripts that can validate or sanitize them.
  • Apply strict validation on workflow inputs (e.g., enumerated choices, regex constraints, or restricted formats) to limit allowable values.
  • Use shell-safe quoting patterns when interpolation is unavoidable, and avoid allowing control characters such as ;, &, |, backticks, or $() in inputs.
  • Run CI jobs with least-privilege tokens and scoped permissions to reduce the blast radius if a command is abused.
  • Treat release pipelines as high-trust contexts and minimize the number of workflows and inputs that can influence them.

How teams detect issues like this

Detection generally involves reviewing workflows for unsafe shell construction patterns:

  • Static analysis: Scan .github/workflows/*.yml for run: steps where ${{ inputs.* }}, ${{ github.event.inputs.* }}, or other user-controlled expressions are embedded directly into shell commands, especially near metacharacters.
  • Code review signals: Flag workflows that:
  • Use string concatenation to build shell commands.
  • Accept free-form text inputs that influence run: without validation.
  • Run in high-privilege contexts (e.g., release or publish steps) while consuming untrusted inputs.
  • Policy enforcement: Apply repository or organization policies that require:
  • Centralized review of CI workflows.
  • Use of approved composite actions or scripts instead of ad hoc shell fragments.
  • CI linting tools that enforce safe patterns for command execution and input handling.
  • Automated security tools or GitHub Apps can be configured to inspect workflow changes and block merges that introduce new command injection sinks.

Sources

SourceLink
github.comgithub.com/NationalSecurityAgency/emissary/pull/1286
github.comgithub.com/NationalSecurityAgency/emissary/pull/1288
github.comgithub.com/NationalSecurityAgency/emissary/security/advisories/GHSA-3g6g-gq4r-xjm9

Frequently asked

questions

Typically no. Exploitation relies on the ability to influence the workflow definition or the values of inputs it trusts. In this case, an attacker generally needs repository write access or control over how workflow_dispatch is invoked in a trusted context.

The described scenario assumes repository write access, such as a maintainer account, a compromised collaborator, or a malicious change that gets merged. Once a vulnerable workflow is in place, the attacker can trigger it with crafted inputs to achieve command execution in the CI environment.

The safest pattern is to stop embedding user-controlled values directly in shell commands. Instead, pass inputs as data (arguments or environment variables) into scripts or tooling that perform validation and treat them as values, not code, and use constrained input types where possible.

Adopting secure-by-default CI patterns is key: avoid ad hoc shell composition, enforce validation and allowed-lists for inputs, use reusable composite actions or scripts for complex logic, and apply automated checks or reviews for any changes to CI/CD workflows, especially those involved in build and release processes.

Find out what's already
exploitable in your codebase.