Vulnerabilities in pkg:npm/@backstage/backend-common

PACKAGE
Advisory Identifier: GHSA-2fc9-xpp8-2g9h
Advisory Summary

CVE-2024-26150 is a HIGH (CVSS 8.7) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting @backstage/backend common libraries in the npm ecosystem. The issue involves `@backstage/backend-common` vulnerable to path traversal through symlinks. Remediation is available by upgrading affected packages to version 0.21.1, 0.19.10, 0.20.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@backstage/backend-common

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@backstage/backend-common. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-2fc9-xpp8-2g9h CVE-2024-26150 HIGH `@backstage/backend-common` vulnerable to path traversal through symlinks

CVE-2024-26150 at a Glance

CVE Identifier CVE-2024-26150
GHSA Identifier GHSA-2fc9-xpp8-2g9h
Severity HIGH
CVSS v3.1 Base Score 8.7
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product @backstage/backend common
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.7

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

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

How to Fix CVE-2024-26150

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

@backstage/backend-common fixed: 0.21.1
npm install @backstage/backend-common@0.21.1
@backstage/backend-common fixed: 0.19.10
npm install @backstage/backend-common@0.19.10
@backstage/backend-common fixed: 0.20.2
npm install @backstage/backend-common@0.20.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 @backstage/backend-common

How to Check if You Are Affected

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

npm ls @backstage/backend-common

Analyze the terminal output to locate any version of @backstage/backend common in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.21.1), your application is affected.

Note: The npm ls @backstage/backend-common 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 @backstage/backend common, 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 Paths checks with the `resolveSafeChildPath` utility were not exhaustive enough, leading to risk of path traversal vulnerabilities if symlinks can be injected by attackers. ### Patches Patched in `@backstage/backend-common` version `0.21.1`. Patched in `@backstage/backend-common` version `0.20.2`. Patched in `@backstage/backend-common` version `0.19.10`. ### For more information If you have any questions or comments about this advisory: - Open an issue in the [Backstage repository](https://github.com/backstage/backstage) - Visit our Discord, linked to in [Backstage README](https://github.com/backstage/backstage)

CVE-2024-26150 Affected @backstage/backend common Versions

3 component(s)
Fixed Versions:
0.21.10.19.100.20.2
Product / Package Ecosystem Affected Versions Fixed Version
@backstage/backend-common
npm
≥ 0.21.0
< 0.21.1
All 1 versions
0.21.0
0.21.1
@backstage/backend-common
npm
< 0.19.10
0.19.10
@backstage/backend-common
npm
≥ 0.20.0
< 0.20.2
0.20.2

References

Frequently Asked Questions

What is CVE-2024-26150?
CVE-2024-26150 is a security vulnerability in @backstage/backend common involving `@backstage/backend-common` vulnerable to path traversal through symlinks under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which @backstage/backend common versions are affected?
Affected versions include releases prior to 0.21.1, 0.19.10, 0.20.2 across affected packages: @backstage/backend-common.
What version fixes CVE-2024-26150?
Upgrading to 0.21.1, 0.19.10, 0.20.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @backstage/backend-common affected?
Yes, @backstage/backend-common is affected in releases prior to 0.21.1, 0.19.10, 0.20.2. Upgrade your dependency to 0.21.1, 0.19.10, 0.20.2 or later.
What is the CVSS score of CVE-2024-26150?
CVE-2024-26150 has a CVSS v3.1 base score of 8.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2024-26150?
CVE-2024-26150 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-2024-26150?
Run the dependency tree command: 'npm ls @backstage/backend-common'. 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-2fc9-xpp8-2g9h",
  "modified" : "2024-02-23T19:43:19Z",
  "published" : "2024-02-23T18:02:08Z",
  "aliases" : [ "CVE-2024-26150" ],
  "summary" : "`@backstage/backend-common` vulnerable to path traversal through symlinks",
  "details" : "### Impact\n\nPaths checks with the `resolveSafeChildPath` utility were not exhaustive enough, leading to risk of path traversal vulnerabilities if symlinks can be injected by attackers.\n\n### Patches\nPatched in `@backstage/backend-common` version `0.21.1`.\nPatched in `@backstage/backend-common` version `0.20.2`.\nPatched in `@backstage/backend-common` version `0.19.10`.\n\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n- Open an issue in the [Backstage repository](https://github.com/backstage/backstage)\n- Visit our Discord, linked to in [Backstage README](https://github.com/backstage/backstage)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@backstage/backend-common"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.21.0"
      }, {
        "fixed" : "0.21.1"
      } ]
    } ],
    "versions" : [ "0.21.0" ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@backstage/backend-common"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.19.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@backstage/backend-common"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.20.0"
      }, {
        "fixed" : "0.20.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/backstage/backstage/security/advisories/GHSA-2fc9-xpp8-2g9h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-26150"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/backstage/backstage/commit/1ad2b1b61ebb430051f7d804b0cc7ebfe7922b6f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/backstage/backstage/commit/78f892b3a84d63de2ba167928f171154c447b717"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/backstage/backstage/commit/edf65d7d31e027599c2415f597d085ee84807871"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/backstage/backstage"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-23T18:02:08Z",
    "nvd_published_at" : "2024-02-23T16:15:48Z"
  }
}