CVE-2021-43838
JSON

5.3medium

Regular Expression Denial of Service (ReDoS) in jsx-slack

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.42% (higher than 73% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-55xv-f85c-248q

Description

jsx-slack is a library for building JSON objects for Slack Block Kit surfaces from JSX. In versions prior to 4.5.1 users are vulnerable to a regular expression denial-of-service (ReDoS) attack. 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. jsx-slack v4.5.1 has patched to a regex for escaping blockquote characters. Users are advised to upgrade as soon as possible.

Affected

Product or packageVersionsReported by
yhatt jsx-slack< 4.5.1CVE List
jsx-slack (npm)before 4.5.1GitHub Advisory Database
jsx-slack_project jsx-slackbefore 4.5.2NVD

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHub3.7low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P

Classification

What each source says

CVE List

jsx-slack is a library for building JSON objects for Slack Block Kit surfaces from JSX. In versions prior to 4.5.1 users are vulnerable to a regular expression denial-of-service (ReDoS) attack. 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. jsx-slack v4.5.1 has patched to a regex for escaping blockquote characters. Users are advised to upgrade as soon as possible.

GitHub Advisory Database

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.

/** @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
Credits

Thanks to @hieki for finding out this vulnerability.

NVD (es)

jsx-slack es una biblioteca para construir objetos JSON para las superficies del Slack Block Kit desde JSX. En versiones anteriores a la 4.5.1, los usuarios son vulnerables a un ataque de denegación de servicio por expresión regular (ReDoS). Si el atacante puede poner muchos elementos JSX en la etiqueta "<blockquote>", una expresión regular interna para escapar caracteres puede consumir una cantidad excesiva de recursos informáticos. jsx-slack versión v4.5.1 ha parcheado a una expresión regular para escapar caracteres de blockquote. Se recomienda a usuarios que se actualicen lo antes posible</blockquote>

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2021-43838 changed 2024-08-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-55xv-f85c-248q changed 2026-07-08CC-BY-4.0
NVDCVE-2021-43838 changed 2026-06-17Public domain