GitHub Advisoryadvisory · npm

GHSA-55xv-f85c-248q Regular Expression Denial of Service (ReDoS) in jsx-slack

LOW Published 2021-12-17 Modified 2022-01-04 Official page ↗
Aliases
CVE-2021-43838
Ecosystem
npm
Packages
jsx-slack
Severity
Low
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
Weaknesses
CWE-1333, CWE-400
Reviewed
2021-12-17

Affected packages

• npm jsx-slack: < 4.5.1 → fixed in 4.5.1

Description

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 `` 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( {[...Array(40)].map((_, i) => ( {i + 1} ))} ) ``` 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.

Related

Alias · CVE (1)

  • CVE-2021-43838 jsx-slack is a library for building JSON objects for Slack Block Kit surfaces from JSX. vulnerability

Weakness · CWE (2)

  • CWE-1333 Inefficient Regular Expression Complexity weakness
  • CWE-400 Uncontrolled Resource Consumption weakness

References