# Delimiter injection in GitHub Actions core.exportVariable

core.exportVariable used a fixed delimiter an attacker could inject to break out and set arbitrary environment variables in GITHUB_ENV, enabling runner RCE.

- Payout: $4,617
- Severity: medium
- Program: GitHub
- Found by: jupenur
- Disclosed: 2022-08-18
- CVE: CVE-2022-35954
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1625652
- Library page: https://bugbountylibrary.com/r/h1%3A1625652
- Tags: area:oss domain:oss impact:integrity impact:rce kind:bounty platform:hackerone sev:medium tech:github-actions technique:chained vuln:command-injection vuln:misconfiguration

**Target:** @actions/core exportVariable / GITHUB_ENV file command
**Root cause:** core.exportVariable writes values to GITHUB_ENV using a fixed delimiter `_GitHubActionsFileCommandDelimeter_` without escaping it, so untrusted input containing the delimiter can inject additional variable assignments.
**Steps:**
1. Workflow calls `core.exportVariable(name, untrustedValue)` where value is attacker-controlled.
2. Attacker supplies value containing `_GitHubActionsFileCommandDelimeter_` followed by a new `VAR=value` line.
3. The GITHUB_ENV file command parser treats the injected line as a separate variable assignment.
4. Arbitrary env vars (e.g. PATH) are set for subsequent steps.
**How found:** Researcher noticed the fixed, well-known delimiter used in the GITHUB_ENV file command format and hypothesized that unescaped untrusted input could break out of the value field.
**Exploitation:** Attacker injects the delimiter plus crafted variable assignments into a value written via exportVariable; the runner parses them as additional env vars, and per report #1637621 this was chained to achieve RCE in the Actions runner.
**Escalation:** Chained with runner behavior to escalate from arbitrary env var control to remote code execution (demonstrated in separate report #1637621).
**Insight:** File-command formats (GITHUB_ENV, GITHUB_OUTPUT, GITHUB_PATH) rely on delimiters; any fixed delimiter in a library helper is an injection primitive when values are attacker-influenced—test delimiter breakout, not just newline injection.

