CVE-2023-34245: @udecode/plate link ` Scheme Vulnerability

HIGH
Advisory Identifier: GHSA-4882-hxpr-hrvm
CVSS 8.1
CWE-79
Published
Advisory Summary

CVE-2023-34245 is a HIGH (CVSS 8.1) ` scheme vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @udecode/plate link libraries in the npm ecosystem. The issue involves ` scheme. Remediation is available by upgrading affected packages to version 20.0.0.

CVE-2023-34245 at a Glance

CVE Identifier CVE-2023-34245
GHSA Identifier GHSA-4882-hxpr-hrvm
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @udecode/plate link
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

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

How to Fix CVE-2023-34245

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

@udecode/plate-link fixed: 20.0.0
npm install @udecode/plate-link@20.0.0
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 @udecode/plate-link

How to Check if You Are Affected

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

npm ls @udecode/plate-link

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

Note: The npm ls @udecode/plate-link 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 @udecode/plate link, 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 Affected versions of the link plugin and link UI component do not sanitize URLs to prevent use of the `javascript:` scheme. As a result, links with JavaScript URLs can be inserted into the Plate editor through various means, including opening or pasting malicious content. ### Patches `@udecode/plate-link` 20.0.0 resolves this issue by introducing an `allowedSchemes` option to the link plugin, defaulting to `['http', 'https', 'mailto', 'tel']`. URLs using a scheme that isn't in this list will not be rendered to the DOM. ### Workarounds If you are unable to update `@udecode/plate-link` to version 20.0.0, we recommend overriding the `LinkElement` and `PlateFloatingLink` components with implementations that explicitly check the URL scheme before rendering any anchor elements.

CVE-2023-34245 Affected @udecode/plate link Versions

1 component(s)
Fixed Versions:
20.0.0
Product / Package Ecosystem Affected Versions Fixed Version
@udecode/plate-link
npm
< 20.0.0
20.0.0

References

Frequently Asked Questions

What is CVE-2023-34245?
CVE-2023-34245 is a security vulnerability in @udecode/plate link involving ` scheme under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @udecode/plate link versions are affected?
Affected versions include releases prior to 20.0.0 across affected packages: @udecode/plate-link.
What version fixes CVE-2023-34245?
Upgrading to 20.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @udecode/plate-link affected?
Yes, @udecode/plate-link is affected in releases prior to 20.0.0. Upgrade your dependency to 20.0.0 or later.
What is the CVSS score of CVE-2023-34245?
CVE-2023-34245 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2023-34245?
CVE-2023-34245 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-34245?
Run the dependency tree command: 'npm ls @udecode/plate-link'. 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-4882-hxpr-hrvm",
  "modified" : "2023-06-09T22:41:56Z",
  "published" : "2023-06-09T22:41:56Z",
  "aliases" : [ "CVE-2023-34245" ],
  "summary" : "@udecode/plate-link does not sanitize URLs to prevent use of the `javascript:` scheme",
  "details" : "### Impact\nAffected versions of the link plugin and link UI component do not sanitize URLs to prevent use of the `javascript:` scheme. As a result, links with JavaScript URLs can be inserted into the Plate editor through various means, including opening or pasting malicious content.\n\n### Patches\n`@udecode/plate-link` 20.0.0 resolves this issue by introducing an `allowedSchemes` option to the link plugin, defaulting to `['http', 'https', 'mailto', 'tel']`. URLs using a scheme that isn't in this list will not be rendered to the DOM.\n\n### Workarounds\nIf you are unable to update `@udecode/plate-link` to version 20.0.0, we recommend overriding the `LinkElement` and `PlateFloatingLink` components with implementations that explicitly check the URL scheme before rendering any anchor elements.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@udecode/plate-link"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "20.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/udecode/plate/security/advisories/GHSA-4882-hxpr-hrvm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34245"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/udecode/plate/pull/2240"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/udecode/plate/commit/93dd5712854660874900ae12e4d8e6ff28089eb7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/udecode/plate"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-09T22:41:56Z",
    "nvd_published_at" : "2023-06-09T18:15:09Z"
  }
}