CVE-2022-35954: @actions/core @actions/core Has Delimiter Injection Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-7r3h-m5j6-3q42
CVSS 5.0
CWE-74 CWE-77
Published
Advisory Summary

CVE-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.

CVE-2022-35954 at a Glance

CVE Identifier CVE-2022-35954
GHSA Identifier GHSA-7r3h-m5j6-3q42
Severity MODERATE
CVSS v3.1 Base Score 5.0
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product @actions/core
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (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.

@actions/core fixed: 1.9.1
npm install @actions/core@1.9.1
Verify Direct and Transitive Dependencies

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

## Impact 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. ## Patches Users should upgrade to `@actions/core v1.9.1`. ## Workarounds 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`. ## References [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) If you have any questions or comments about this advisory: * Open an issue in [`actions/toolkit`](https://github.com/actions/toolkit/issues)

CVE-2022-35954 Affected @actions/core Versions

1 component(s)
Fixed Versions:
1.9.1
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?
CVE-2022-35954 is a security vulnerability in @actions/core involving @actions/core has Delimiter Injection Vulnerability in exportVariable under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which @actions/core versions are affected?
Affected versions include releases prior to 1.9.1 across affected packages: @actions/core.
What version fixes CVE-2022-35954?
Upgrading to 1.9.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @actions/core affected?
Yes, @actions/core is affected in releases prior to 1.9.1. Upgrade your dependency to 1.9.1 or later.
What is the CVSS score of CVE-2022-35954?
CVE-2022-35954 has a CVSS v3.1 base score of 5.0 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:N.
What CWE is associated with CVE-2022-35954?
CVE-2022-35954 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 npm dependencies for CVE-2022-35954?
Run the dependency tree command: 'npm ls @actions/core'. 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-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"
  }
}