CVE-2021-4306: Terminal kit Terminal-kit Inefficient Regular Expression Complexity Vulnerability
HIGHCVE-2021-4306 is a HIGH (CVSS 7.5) terminal-kit inefficient regular expression complexity vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Terminal kit libraries in the npm ecosystem. The issue involves terminal-kit inefficient regular expression complexity vulnerability. Remediation is available by upgrading affected packages to version 2.1.8.
CVE-2021-4306 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2021-4306
To remediate this vulnerability, upgrade all affected Terminal kit 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 terminal-kit@2.1.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls terminal-kit
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-4306, inspect your project dependencies using npm:
npm ls terminal-kit
Analyze the terminal output to locate any version of Terminal kit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.8), your application is affected.
Note: The npm ls terminal-kit 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-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Terminal kit, 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-4306 Affected Terminal kit Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
terminal-kit
|
npm |
< 2.1.8
|
2.1.8
|
References
Frequently Asked Questions
What is CVE-2021-4306?
Which Terminal kit versions are affected?
What version fixes CVE-2021-4306?
Is terminal-kit affected?
What is the CVSS score of CVE-2021-4306?
What CWE is associated with CVE-2021-4306?
How can I check npm dependencies for CVE-2021-4306?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wxgh-8gmr-3qh3",
"modified" : "2023-01-12T23:43:03Z",
"published" : "2023-01-07T18:30:20Z",
"aliases" : [ "CVE-2021-4306" ],
"summary" : "terminal-kit Inefficient Regular Expression Complexity vulnerability",
"details" : "A vulnerability classified as problematic has been found in cronvel terminal-kit up to 2.1.7. Affected is an unknown function. The manipulation leads to inefficient regular expression complexity. Upgrading to version 2.1.8 can address this issue. The name of the patch is a2e446cc3927b559d0281683feb9b821e83b758c. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-217620.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "terminal-kit"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.8"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-4306"
}, {
"type" : "WEB",
"url" : "https://github.com/cronvel/terminal-kit/commit/a2e446cc3927b559d0281683feb9b821e83b758c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cronvel/terminal-kit"
}, {
"type" : "WEB",
"url" : "https://github.com/cronvel/terminal-kit/releases/tag/v2.1.8"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?ctiid.217620"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.217620"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-01-12T23:43:03Z",
"nvd_published_at" : "2023-01-07T17:15:00Z"
}
}