Electron CVE-2022-35954 Delimiter Injection Vulnerability in exportVariable
The core.exportVariable function in @actions/core used a fixed delimiter that attackers could inject to break out of the intended variable and set arbitrary environment variables. Workflows that write untrusted values to GITHUB_ENV could have their path or other environment variables modified without the author's intention.
Originally disclosed on HackerOne
- Fixed in 15 days
- Disclosed after 15 days
Describe the summary:
The Electron Website provides a set of packages to make creating actions easier. The core.exportVariable function uses a well known delimiter that attackers can use to break out of that specific variable and assign values to other arbitrary variables. Workflows that write untrusted values to the GITHUB_ENV file may cause the path or other environment variables to be modified without the intention of the workflow or action author. Users should upgrade to @actions/core v1.9.1. If you are unable to upgrade the @actions/core package, you can modify your action to ensure that any user input does not contain the delimiter _GitHubActionsFileCommandDelimeter_ before calling core.exportVariable.
Impact
CVE-2022-35954 CWE-74 CWE-77 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:N
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could modify the path or other environment variables in a workflow that writes untrusted values to GITHUB_ENV, potentially altering the behaviour of subsequent steps.
What the attacker needed
Workflow writes untrusted input to GITHUB_ENV; attacker can control part of that input
The fix
Users should upgrade to @actions/core v1.9.1; if unable, ensure user input does not contain the delimiter before calling core.exportVariable.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a GitHub Actions workflow wants to set an environment variable for later steps, it writes a line to a special file. The toolkit that writes this line used a fixed marker to separate the variable name from its value. If an attacker can control part of the value, they can include that marker and then add their own fake variable, tricking the workflow into using the attacker's settings.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.