Vulnerabilities in pkg:npm/@webiny/react-rich-text-renderer

PACKAGE
Advisory Identifier: GHSA-3x59-vrmc-5mx6
Advisory Summary

CVE-2023-41167 is a MODERATE (CVSS 4.8) @webiny/react-rich-text-renderer vulnerable to insecure rendering vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @webiny/react rich text renderer libraries in the npm ecosystem. The issue involves @webiny/react-rich-text-renderer vulnerable to insecure rendering of rich text content. Remediation is available by upgrading affected packages to version 5.37.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@webiny/react-rich-text-renderer

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@webiny/react-rich-text-renderer. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-3x59-vrmc-5mx6 CVE-2023-41167 MODERATE @webiny/react-rich-text-renderer vulnerable to insecure rendering of rich text content

CVE-2023-41167 at a Glance

CVE Identifier CVE-2023-41167
GHSA Identifier GHSA-3x59-vrmc-5mx6
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @webiny/react rich text renderer
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.8

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

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

How to Fix CVE-2023-41167

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

@webiny/react-rich-text-renderer fixed: 5.37.2
npm install @webiny/react-rich-text-renderer@5.37.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 @webiny/react-rich-text-renderer

How to Check if You Are Affected

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

npm ls @webiny/react-rich-text-renderer

Analyze the terminal output to locate any version of @webiny/react rich text renderer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.37.2), your application is affected.

Note: The npm ls @webiny/react-rich-text-renderer 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 @webiny/react rich text renderer, 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

## Overview `@webiny/react-rich-text-renderer` is a react component to render data coming from Webiny Headless CMS and Webiny Form Builder. The `@webiny/react-rich-text-renderer` package depends on the [editor.js](https://editorjs.io/) rich text editor to handle rich text content. The CMS stores rich text content from the `editor.js` into the database. When the `@webiny/react-rich-text-renderer` is used to render such content, it uses the `dangerouslySetInnerHTML` prop, without applying HTML sanitization. The issue arises when an actor, who in this context would specifically be a content manager with access to the CMS, inserts a malicious script as part of the user-defined input. This script is then injected and executed within the user's browser when the main page or admin page loads. ## Am I affected? You will be affected if you're running a Webiny project created prior to `5.35.0` and you're using the legacy rich text editor (which uses `editor.js` library under the hood). If you've already switched to using the new rich text editor, powered by Lexical editor, you will not be affected by this. ## How do I patch this vulnerability? Update to Webiny version `5.37.2`.

CVE-2023-41167 Affected @webiny/react rich text renderer Versions

1 component(s)
Fixed Versions:
5.37.2
Product / Package Ecosystem Affected Versions Fixed Version
@webiny/react-rich-text-renderer
npm
< 5.37.2
5.37.2

References

Frequently Asked Questions

What is CVE-2023-41167?
CVE-2023-41167 is a security vulnerability in @webiny/react rich text renderer involving @webiny/react-rich-text-renderer vulnerable to insecure rendering of rich text content under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @webiny/react rich text renderer versions are affected?
Affected versions include releases prior to 5.37.2 across affected packages: @webiny/react-rich-text-renderer.
What version fixes CVE-2023-41167?
Upgrading to 5.37.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @webiny/react-rich-text-renderer affected?
Yes, @webiny/react-rich-text-renderer is affected in releases prior to 5.37.2. Upgrade your dependency to 5.37.2 or later.
What is the CVSS score of CVE-2023-41167?
CVE-2023-41167 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2023-41167?
CVE-2023-41167 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-41167?
Run the dependency tree command: 'npm ls @webiny/react-rich-text-renderer'. 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-3x59-vrmc-5mx6",
  "modified" : "2023-08-31T18:51:43Z",
  "published" : "2023-08-24T22:16:20Z",
  "aliases" : [ "CVE-2023-41167" ],
  "summary" : "@webiny/react-rich-text-renderer vulnerable to insecure rendering of rich text content",
  "details" : "## Overview\n`@webiny/react-rich-text-renderer` is a react component to render data coming from Webiny Headless CMS and Webiny Form Builder. The `@webiny/react-rich-text-renderer` package depends on the [editor.js](https://editorjs.io/) rich text editor to handle rich text content. The CMS stores rich text content from the `editor.js` into the database. When the `@webiny/react-rich-text-renderer` is used to render such content, it uses the `dangerouslySetInnerHTML` prop, without applying HTML sanitization. The issue arises when an actor, who in this context would specifically be a content manager with access to the CMS, inserts a malicious script as part of the user-defined input. This script is then injected and executed within the user's browser when the main page or admin page loads.\n\n## Am I affected?\nYou will be affected if you're running a Webiny project created prior to `5.35.0` and you're using the legacy rich text editor (which uses `editor.js` library under the hood). If you've already switched to using the new rich text editor, powered by Lexical editor, you will not be affected by this.\n\n## How do I patch this vulnerability?\nUpdate to Webiny version `5.37.2`.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@webiny/react-rich-text-renderer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.37.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.37.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/webiny/webiny-js/security/advisories/GHSA-3x59-vrmc-5mx6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41167"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/webiny/webiny-js/commit/8748bc53fe862bb03d4459ccc0be39084a5d35c0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/webiny/webiny-js"
  }, {
    "type" : "WEB",
    "url" : "https://webiny.com"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-24T22:16:20Z",
    "nvd_published_at" : "2023-08-25T14:15:10Z"
  }
}