CVE-2021-43838: Jsx slack Denial of Service Vulnerability

LOW
Advisory Identifier: GHSA-55xv-f85c-248q
CVSS 3.7
CWE-400 CWE-1333
Published
Advisory Summary

CVE-2021-43838 is a LOW (CVSS 3.7) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Jsx slack libraries in the npm ecosystem. The issue involves regular expression denial of service (redos) in jsx-slack. Remediation is available by upgrading affected packages to version 4.5.1.

CVE-2021-43838 at a Glance

CVE Identifier CVE-2021-43838
GHSA Identifier GHSA-55xv-f85c-248q
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Jsx slack
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

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

How to Fix CVE-2021-43838

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

jsx-slack fixed: 4.5.1
npm install jsx-slack@4.5.1
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 jsx-slack

How to Check if You Are Affected

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

npm ls jsx-slack

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

Note: The npm ls jsx-slack 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Jsx slack, 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

jsx-slack v4.5.1 and earlier versions are vulnerable to a regular expression denial-of-service (ReDoS) attack. ### Impact If attacker can put a lot of JSX elements into `<blockquote>` tag, an internal regular expression for escaping characters may consume an excessive amount of computing resources. ```javascript /** @jsxImportSource jsx-slack */ import { Section } from 'jsx-slack' console.log( <Section> <blockquote> {[...Array(40)].map((_, i) => ( <p>{i + 1}</p> ))} </blockquote> </Section> ) ``` ### Patches _See also: https://github.com/yhatt/jsx-slack/security/advisories/GHSA-hp68-xhvj-x6j6_ jsx-slack v4.5.2 has updated regular expressions to prevent catastrophic backtracking. jsx-slack v4.5.1 also had patched a workaround. It has no problems to contents with ASCII characters, but _still vulnerable to contents with multibyte characters_. (https://github.com/yhatt/jsx-slack/commit/36e4a10405e4c7745333e245fcc5029c02c7065d) ### References - https://nvd.nist.gov/vuln/detail/CVE-2021-43838 - https://github.com/yhatt/jsx-slack/commit/36e4a10405e4c7745333e245fcc5029c02c7065d ### Credits Thanks to @hieki for finding out this vulnerability.

CVE-2021-43838 Affected Jsx slack Versions

1 component(s)
Fixed Versions:
4.5.1
Product / Package Ecosystem Affected Versions Fixed Version
jsx-slack
npm
< 4.5.1
4.5.1

References

Frequently Asked Questions

What is CVE-2021-43838?
CVE-2021-43838 is a security vulnerability in Jsx slack involving Regular Expression Denial of Service (ReDoS) in jsx-slack under CWE-400: Uncontrolled Resource Consumption.
Which Jsx slack versions are affected?
Affected versions include releases prior to 4.5.1 across affected packages: jsx-slack.
What version fixes CVE-2021-43838?
Upgrading to 4.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jsx-slack affected?
Yes, jsx-slack is affected in releases prior to 4.5.1. Upgrade your dependency to 4.5.1 or later.
What is the CVSS score of CVE-2021-43838?
CVE-2021-43838 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2021-43838?
CVE-2021-43838 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2021-43838?
Run the dependency tree command: 'npm ls jsx-slack'. 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-55xv-f85c-248q",
  "modified" : "2022-01-04T19:52:06Z",
  "published" : "2021-12-17T19:59:02Z",
  "aliases" : [ "CVE-2021-43838" ],
  "summary" : "Regular Expression Denial of Service (ReDoS) in jsx-slack",
  "details" : "jsx-slack v4.5.1 and earlier versions are vulnerable to a regular expression denial-of-service (ReDoS) attack. \n\n### Impact\n\nIf attacker can put a lot of JSX elements into `<blockquote>` tag, an internal regular expression for escaping characters may consume an excessive amount of computing resources.\n\n```javascript\n/** @jsxImportSource jsx-slack */\nimport { Section } from 'jsx-slack'\n\nconsole.log(\n  <Section>\n    <blockquote>\n      {[...Array(40)].map((_, i) => (\n        <p>{i + 1}</p>\n      ))}\n    </blockquote>\n  </Section>\n)\n```\n\n### Patches\n\n_See also: https://github.com/yhatt/jsx-slack/security/advisories/GHSA-hp68-xhvj-x6j6_\n\njsx-slack v4.5.2 has updated regular expressions to prevent catastrophic backtracking.\n\njsx-slack v4.5.1 also had patched a workaround. It has no problems to contents with ASCII characters, but _still vulnerable to contents with multibyte characters_. (https://github.com/yhatt/jsx-slack/commit/36e4a10405e4c7745333e245fcc5029c02c7065d)\n\n### References\n\n- https://nvd.nist.gov/vuln/detail/CVE-2021-43838\n- https://github.com/yhatt/jsx-slack/commit/36e4a10405e4c7745333e245fcc5029c02c7065d\n\n### Credits\n\nThanks to @hieki for finding out this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jsx-slack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/yhatt/jsx-slack/security/advisories/GHSA-55xv-f85c-248q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43838"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yhatt/jsx-slack/commit/36e4a10405e4c7745333e245fcc5029c02c7065d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/yhatt/jsx-slack"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333", "CWE-400" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-12-17T19:33:23Z",
    "nvd_published_at" : "2021-12-17T19:15:00Z"
  }
}