Summary
The local GitHub Actions runner act processes deprecated workflow commands ::set-env:: and ::add-path:: without restriction, allowing environment injection when untrusted data is echoed to stdout.
An attacker who can influence workflow step output may set arbitrary environment variables or alter the PATH for subsequent steps in a job, enabling command hijacking and unintended code execution in CI pipelines.
Affected context
This vulnerability occurs in local or self-managed CI environments that use act to run GitHub Actions workflows and rely on workflow step output that includes untrusted or partially untrusted data.
It becomes risky when workflows:
- Echo or print user-controlled data directly to stdout,
- Do not sanitize or encode this output,
- And run additional steps whose behavior depends on environment variables or PATH ordering.
Exploit preconditions
- Attack surface: GitHub Actions workflows executed via
acton developer machines or CI runners. - Required access: Ability to control or influence the content emitted by a workflow step to stdout (e.g., via pull request inputs, repository contents, or task parameters).
- Trigger point: A workflow step that echoes the crafted
::set-env::or::add-path::sequences as part of its output. - Why exploitation is possible:
actcontinues to interpret deprecated command syntax as control directives, so attacker-controlled output is parsed as workflow commands rather than inert data.
Why this happens
The core issue is treating plain text output from workflow steps as trusted command input, without constraining who can emit those commands or whether they contain untrusted data.
act unconditionally honors the deprecated ::set-env:: and ::add-path:: command formats, which GitHub disabled upstream due to environment injection concerns.
This aligns with CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because special command markers in stdout are not neutralized before being interpreted by the workflow runner as instructions to modify the execution environment.
Potential impact
- An attacker could set arbitrary environment variables for subsequent workflow steps.
- An attacker could prepend malicious directories to the PATH, potentially hijacking commands executed later in the workflow.
- Workflows may unintentionally run attacker-controlled binaries or scripts instead of trusted system tools.
- Secrets or tokens accessed by later steps could be exfiltrated via manipulated environment variables.
- Build outputs or test results may be tampered with, corrupting CI integrity and supply-chain trust.
General mitigation guidance
Effective mitigation focuses on eliminating or strictly controlling interpretation of special command syntax in workflow output and reducing trust in step output:
- Stop honoring deprecated workflow command formats (
::set-env::,::add-path::), or gate them behind explicit configuration. - Treat all step stdout as data by default, and avoid interpreting it as control input unless it comes from trusted components.
- Where commands must be supported, validate and constrain the allowable environment keys and values, and restrict PATH changes to known-safe locations.
- Minimize reliance on environment variables for security-sensitive behavior; prefer explicit configuration and scoped tokens.
- Run workflows with least privilege and avoid granting unnecessary filesystem or network capabilities to steps that process untrusted input.
How teams detect issues like this
Detection can combine workflow review, static policy checks, and runtime monitoring:
- Use static analysis or policy-as-code tools to scan workflow definitions for steps that echo untrusted inputs directly to stdout.
- During code review, flag patterns where workflow commands are constructed from user-controlled data or repository content that can be modified by external contributors.
- Instrument
actor wrapper scripts to log and optionally block usage of deprecated command syntaxes, especially when originating from untrusted steps. - Apply CI guardrails that distinguish trusted and untrusted workflows or jobs, enforcing stricter rules on those processing external contributions.

