Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1ocDY4LXhodmoteDZqNs0gsg

jsx-slack insufficient patch for CVE-2021-43838 ReDoS

We found the patch for CVE-2021-43838 in jsx-slack v4.5.1 is insufficient to save from Regular Expression Denial of Service (ReDoS) attack.

This vulnerability affects to jsx-slack v4.5.1 and earlier versions.

Impact

If attacker can put a lot of JSX elements into <blockquote> tag with including multibyte characters, an internal regular expression for escaping characters may consume an excessive amount of computing resources.

/** @jsxImportSource jsx-slack */
import { Section } from 'jsx-slack'

console.log(
  <Section>
    <blockquote>
      {[...Array(40)].map(() => (
        <p>亜</p>
      ))}
    </blockquote>
  </Section>
)

v4.5.1 has released by passing the test against ASCII characters but missed the case of multibyte characters.
https://github.com/yhatt/jsx-slack/security/advisories/GHSA-55xv-f85c-248q

Patches

jsx-slack v4.5.2 has updated regular expressions for escaping blockquote characters to prevent catastrophic backtracking. It is also including an updated test case to confirm rendering multiple tags in <blockquote> with multibyte characters.

References

Credits

Thanks to @hieki for finding out this vulnerability.

Permalink: https://github.com/advisories/GHSA-hp68-xhvj-x6j6
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1ocDY4LXhodmoteDZqNs0gsg
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: over 2 years ago
Updated: about 1 year ago


CVSS Score: 5.3
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Identifiers: GHSA-hp68-xhvj-x6j6, CVE-2021-43843
References: Repository: https://github.com/yhatt/jsx-slack
Blast Radius: 4.8

Affected Packages

npm:jsx-slack
Dependent packages: 3
Dependent repositories: 8
Downloads: 13,138 last month
Affected Version Ranges: < 4.5.2
Fixed in: 4.5.2
All affected versions: 0.0.0, 3.0.0, 4.0.0, 4.1.0, 4.2.0, 4.2.1, 4.3.0, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.5.0, 4.5.1
All unaffected versions: 4.5.2, 4.5.3, 4.5.4, 4.6.0, 4.6.1, 5.0.0, 5.1.0, 5.2.0, 5.2.1, 5.3.0, 5.3.1, 6.0.0, 6.1.0, 6.1.1