Vulnerabilities in pkg:npm/@actions/core
PACKAGECVE-2022-35954 is a MODERATE (CVSS 5.0) @actions/core has delimiter injection vulnerability vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting @actions/core libraries in the npm ecosystem. The issue involves @actions/core has delimiter injection vulnerability in exportvariable. Remediation is available by upgrading affected packages to version 1.9.1.
pkg:npm/@actions/core
Vulnerability advisories affecting package pkg:npm/@actions/core. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-7r3h-m5j6-3q42 | CVE-2022-35954 | MODERATE | @actions/core has Delimiter Injection Vulnerability in exportVariable |
| GHSA-mfwh-5m23-j46w | CVE-2020-15228 | LOW | Environment Variable Injection in GitHub Actions |
CVE-2022-35954 at a Glance
Security Impact
CVSS: 5.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:N).
How to Fix CVE-2022-35954
To remediate this vulnerability, upgrade all affected @actions/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @actions/core@1.9.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @actions/core
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-35954, inspect your project dependencies using npm:
npm ls @actions/core
Analyze the terminal output to locate any version of @actions/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.1), your application is affected.
Note: The npm ls @actions/core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
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 @actions/core, 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
CVE-2022-35954 Affected @actions/core Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@actions/core
|
npm |
< 1.9.1
|
1.9.1
|
References
Frequently Asked Questions
What is CVE-2022-35954?
Which @actions/core versions are affected?
What version fixes CVE-2022-35954?
Is @actions/core affected?
What is the CVSS score of CVE-2022-35954?
What CWE is associated with CVE-2022-35954?
How can I check npm dependencies for CVE-2022-35954?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7r3h-m5j6-3q42",
"modified" : "2022-08-18T19:01:36Z",
"published" : "2022-08-18T19:01:36Z",
"aliases" : [ "CVE-2022-35954" ],
"summary" : "@actions/core has Delimiter Injection Vulnerability in exportVariable",
"details" : "## Impact\n\nThe `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.\n\n## Patches\n\nUsers should upgrade to `@actions/core v1.9.1`.\n\n## Workarounds\n\nIf 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`.\n\n## References\n\n[More information about setting-an-environment-variable in workflows](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable)\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [`actions/toolkit`](https://github.com/actions/toolkit/issues)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@actions/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.9.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.9.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/actions/toolkit/security/advisories/GHSA-7r3h-m5j6-3q42"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-35954"
}, {
"type" : "WEB",
"url" : "https://github.com/actions/toolkit/commit/4beda9cbc00ba6eefe387a937c21087ccb8ee9df"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/actions/toolkit"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74", "CWE-77" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-08-18T19:01:36Z",
"nvd_published_at" : "2022-08-15T11:21:00Z"
}
}