CVE-2021-43838: Jsx slack Denial of Service Vulnerability
LOWCVE-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
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).
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.
npm install jsx-slack@4.5.1
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
CVE-2021-43838 Affected Jsx slack Versions
1 component(s)| 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?
Which Jsx slack versions are affected?
What version fixes CVE-2021-43838?
Is jsx-slack affected?
What is the CVSS score of CVE-2021-43838?
What CWE is associated with CVE-2021-43838?
How can I check npm dependencies for CVE-2021-43838?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}