Vulnerabilities in pkg:npm/@backstage/catalog-model

PACKAGE
Advisory Identifier: GHSA-7hv8-3fr9-j2hv
Advisory Summary

CVE-2023-25571 is a MODERATE (CVSS 6.8) cross site scripting vulnerability vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @backstage/core components libraries in the npm ecosystem. The issue involves cross site scripting vulnerability in backstage software catalog. Remediation is available by upgrading affected packages to version 0.12.4, 1.2.0, 1.7.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@backstage/catalog-model

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-7hv8-3fr9-j2hv CVE-2023-25571 MODERATE Cross site scripting Vulnerability in backstage Software Catalog

CVE-2023-25571 at a Glance

CVE Identifier CVE-2023-25571
GHSA Identifier GHSA-7hv8-3fr9-j2hv
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @backstage/core components
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.8

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:R/S:C/C:H/I:N/A:N).

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

How to Fix CVE-2023-25571

To remediate this vulnerability, upgrade all affected @backstage/core components 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/core-components fixed: 0.12.4
npm install @backstage/core-components@0.12.4
@backstage/catalog-model fixed: 1.2.0
npm install @backstage/catalog-model@1.2.0
@backstage/plugin-catalog-backend fixed: 1.7.2
npm install @backstage/plugin-catalog-backend@1.7.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/core-components

How to Check if You Are Affected

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

npm ls @backstage/core-components

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

Note: The npm ls @backstage/core-components 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In @backstage/core components, 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 This vulnerability allows a malicious actor with access to add or modify content in an instance of the Backstage software catalog to inject script URLs in the entities stored in the catalog. If users of the catalog then click on said URLs, that can lead to an XSS attack. ### Patches This vulnerability has been patched in both the frontend and backend implementations. The default `Link` component from `@backstage/core-components` will now reject `javascript:` URLs, and there is a global override of `window.open` to do the same. In addition the catalog model as well as the catalog backend now has additional validation built in that prevents `javascript:` URLs in known annotations. ### Workarounds The general practice of limiting access to modifying catalog content and requiring code reviews greatly helps mitigate this vulnerability. ### 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 chat, linked to in the [Backstage README](https://github.com/backstage/backstage)

CVE-2023-25571 Affected @backstage/core components Versions

3 component(s)
Fixed Versions:
0.12.41.2.01.7.2
Product / Package Ecosystem Affected Versions Fixed Version
@backstage/core-components
npm
< 0.12.4
0.12.4
@backstage/catalog-model
npm
< 1.2.0
1.2.0
@backstage/plugin-catalog-backend
npm
< 1.7.2
1.7.2

References

Frequently Asked Questions

What is CVE-2023-25571?
CVE-2023-25571 is a security vulnerability in @backstage/core components involving Cross site scripting Vulnerability in backstage Software Catalog under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @backstage/core components versions are affected?
Affected versions include releases prior to 0.12.4, 1.2.0, 1.7.2 across affected packages: @backstage/core-components, @backstage/catalog-model, @backstage/plugin-catalog-backend.
What version fixes CVE-2023-25571?
Upgrading to 0.12.4, 1.2.0, 1.7.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @backstage/core-components affected?
Yes, @backstage/core-components is affected in releases prior to 0.12.4. Upgrade your dependency to 0.12.4 or later.
Is @backstage/catalog-model affected?
Yes, @backstage/catalog-model is affected in releases prior to 1.2.0. Upgrade your dependency to 1.2.0 or later.
What is the CVSS score of CVE-2023-25571?
CVE-2023-25571 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2023-25571?
CVE-2023-25571 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2023-25571?
Run the dependency tree command: 'npm ls @backstage/core-components'. 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-7hv8-3fr9-j2hv",
  "modified" : "2023-02-14T21:35:10Z",
  "published" : "2023-02-14T21:35:10Z",
  "aliases" : [ "CVE-2023-25571" ],
  "summary" : "Cross site scripting Vulnerability in backstage Software Catalog",
  "details" : "### Impact\n\nThis vulnerability allows a malicious actor with access to add or modify content in an instance of the Backstage software catalog to inject script URLs in the entities stored in the catalog. If users of the catalog then click on said URLs, that can lead to an XSS attack.\n\n### Patches\n\nThis vulnerability has been patched in both the frontend and backend implementations. The default `Link` component from `@backstage/core-components` will now reject `javascript:` URLs, and there is a global override of `window.open` to do the same.\n\nIn addition the catalog model as well as the catalog backend now has additional validation built in that prevents `javascript:` URLs in known annotations.\n\n### Workarounds\n\nThe general practice of limiting access to modifying catalog content and requiring code reviews greatly helps mitigate this vulnerability.\n\n### For more information\n\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 chat, linked to in the [Backstage README](https://github.com/backstage/backstage)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@backstage/core-components"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.12.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@backstage/catalog-model"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@backstage/plugin-catalog-backend"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.7.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/backstage/backstage/security/advisories/GHSA-7hv8-3fr9-j2hv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-25571"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/backstage/backstage/commit/3d1371954512f7fa8bd0e2d357e00eada2c3e8a8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/backstage/backstage"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-14T21:35:10Z",
    "nvd_published_at" : "2023-02-14T18:15:00Z"
  }
}