CVE-2020-15228: @actions/core Environment Variable Injection Vulnerability

LOW
Advisory Identifier: GHSA-mfwh-5m23-j46w
CVSS 3.5
CWE-20 CWE-77
Published
Advisory Summary

CVE-2020-15228 is a LOW (CVSS 3.5) environment variable injection vulnerability (CWE-20: Improper Input Validation) affecting @actions/core libraries in the npm ecosystem. The issue involves environment variable injection in github actions. Remediation is available by upgrading affected packages to version 1.2.6.

CVE-2020-15228 at a Glance

CVE Identifier CVE-2020-15228
GHSA Identifier GHSA-mfwh-5m23-j46w
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-20: Improper Input Validation
Affected Product @actions/core
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2020-15228

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.2.6
npm install @actions/core@1.2.6
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-2020-15228, 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.2.6), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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 `@actions/core` npm module `addPath` and `exportVariable` functions communicate with the Actions Runner over stdout by generating a string in a specific format. Workflows that log untrusted data to stdout may invoke these commands, resulting in the path or environment variables being modified without the intention of the workflow or action author. ### Patches The runner will release an update that disables the `set-env` and `add-path` workflow commands in the near future. For now, users should upgrade to `@actions/core v1.2.6` or later, and replace any instance of the `set-env` or `add-path` commands in their workflows with the new [Environment File Syntax](https://github.com/actions/toolkit/blob/main/docs/commands.md#environment-files). Workflows and actions using the old commands or older versions of the toolkit will start to warn, then error out during workflow execution. ### Workarounds None, it is strongly suggested that you upgrade as soon as possible. ### For more information If you have any questions or comments about this advisory: * Open an issue in [Actions Toolkit](https://github.com/actions/toolkit/issues)

CVE-2020-15228 Affected @actions/core Versions

1 component(s)
Fixed Versions:
1.2.6
Product / Package Ecosystem Affected Versions Fixed Version
@actions/core
npm
< 1.2.6
1.2.6

References

Frequently Asked Questions

What is CVE-2020-15228?
CVE-2020-15228 is a security vulnerability in @actions/core involving Environment Variable Injection in GitHub Actions under CWE-20: Improper Input Validation.
Which @actions/core versions are affected?
Affected versions include releases prior to 1.2.6 across affected packages: @actions/core.
What version fixes CVE-2020-15228?
Upgrading to 1.2.6 (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.2.6. Upgrade your dependency to 1.2.6 or later.
What is the CVSS score of CVE-2020-15228?
CVE-2020-15228 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2020-15228?
CVE-2020-15228 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2020-15228?
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-mfwh-5m23-j46w",
  "modified" : "2021-11-19T15:11:59Z",
  "published" : "2020-10-01T17:16:20Z",
  "aliases" : [ "CVE-2020-15228" ],
  "summary" : "Environment Variable Injection in GitHub Actions",
  "details" : "### Impact\nThe `@actions/core` npm module `addPath` and `exportVariable` functions communicate with the Actions Runner over stdout by generating a string in a specific format. Workflows that log untrusted data to stdout may invoke these commands, resulting in the path or environment variables being modified without the intention of the workflow or action author. \n\n### Patches\nThe runner will release an update that disables the `set-env` and `add-path` workflow commands in the near future. For now, users should upgrade to `@actions/core v1.2.6` or later, and replace any instance of the `set-env` or `add-path` commands in their workflows with the new [Environment File Syntax](https://github.com/actions/toolkit/blob/main/docs/commands.md#environment-files). Workflows and actions using the old commands or older versions of the toolkit will start to warn, then error out during workflow execution.\n\n### Workarounds\nNone, it is strongly suggested that you upgrade as soon as possible.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Actions Toolkit](https://github.com/actions/toolkit/issues)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@actions/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/actions/toolkit/security/advisories/GHSA-mfwh-5m23-j46w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15228"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/actions/toolkit"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/159794/GitHub-Widespread-Injection.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-77" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-10-01T17:16:10Z",
    "nvd_published_at" : "2020-10-01T18:15:00Z"
  }
}