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 package | Versions | Reported by |
|---|---|---|
| yhatt jsx-slack | < 4.5.1 | CVE List |
| jsx-slack (npm) | before 4.5.1 | GitHub Advisory Database |
| jsx-slack_project jsx-slack | before 4.5.2 | NVD |
All scores
| GitHub_M | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 3.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV: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
- 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.
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
| https://github.com/yhatt/jsx-slack/security/advisories/GHSA-55xv-f85c-248q | exploit, patch, third-party-advisory, web | |
| https://github.com/yhatt/jsx-slack/commit/36e4a10405e4c7745333e245fcc5029c02c7065d | patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-43838 | advisory | |
| https://github.com/yhatt/jsx-slack | web | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-43838 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-55xv-f85c-248q changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-43838 changed 2026-06-17 | Public domain |