CVE-2021-3223: Node red dashboard Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-2hw7-mxvj-m455
CWE-22
Published
Advisory Summary

CVE-2021-3223 is a HIGH path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Node red dashboard libraries in the npm ecosystem. The issue involves path traversal in node-red-dashboard. Remediation is available by upgrading affected packages to version 2.26.2.

CVE-2021-3223 at a Glance

CVE Identifier CVE-2021-3223
GHSA Identifier GHSA-2hw7-mxvj-m455
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Node red dashboard
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2021-3223

To remediate this vulnerability, upgrade all affected Node red dashboard dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

node-red-dashboard fixed: 2.26.2
npm install node-red-dashboard@2.26.2
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 node-red-dashboard

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-3223, inspect your project dependencies using npm:

npm ls node-red-dashboard

Analyze the terminal output to locate any version of Node red dashboard in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.26.2), your application is affected.

Note: The npm ls node-red-dashboard 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Node red dashboard, 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

In Node-RED-Dashboard before 2.26.2 there is a path traversal vulnerability. It allows ui_base/js/..%2f directory traversal to read files.

CVE-2021-3223 Affected Node red dashboard Versions

1 component(s)
Fixed Versions:
2.26.2
Product / Package Ecosystem Affected Versions Fixed Version
node-red-dashboard
npm
< 2.26.2
2.26.2

References

Frequently Asked Questions

What is CVE-2021-3223?
CVE-2021-3223 is a security vulnerability in Node red dashboard involving Path traversal in Node-RED-Dashboard under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Node red dashboard versions are affected?
Affected versions include releases prior to 2.26.2 across affected packages: node-red-dashboard.
What version fixes CVE-2021-3223?
Upgrading to 2.26.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is node-red-dashboard affected?
Yes, node-red-dashboard is affected in releases prior to 2.26.2. Upgrade your dependency to 2.26.2 or later.
What CWE is associated with CVE-2021-3223?
CVE-2021-3223 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2021-3223?
Run the dependency tree command: 'npm ls node-red-dashboard'. 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-2hw7-mxvj-m455",
  "modified" : "2021-01-27T23:26:39Z",
  "published" : "2021-01-29T18:13:52Z",
  "aliases" : [ "CVE-2021-3223" ],
  "summary" : "Path traversal in Node-RED-Dashboard",
  "details" : "In Node-RED-Dashboard before 2.26.2 there is a path traversal vulnerability. It allows ui_base/js/..%2f directory traversal to read files.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "node-red-dashboard"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.26.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3223"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/node-red/node-red-dashboard/issues/669"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/node-red/node-red-dashboard/commit/f48f356df966f607ba3d09c27396074b81f2ae97"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/node-red/node-red-dashboard/releases/tag/2.26.2"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/node-red-dashboard"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-01-27T23:26:39Z",
    "nvd_published_at" : "2021-01-26T18:16:00Z"
  }
}