CVE-2021-43309
JavaScript vulnerability analysis and mitigation

Overview

An exponential Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the uri-template-lite npm package, identified as CVE-2021-43309. The vulnerability was discovered by Shachar Menashe and disclosed on August 25, 2022. The vulnerability affects uri-template-lite versions prior to 22.9.0, where an attacker can trigger a denial of service by supplying arbitrary input to the URI.expand method (JFrog Advisory, Snyk Report).

Technical details

The vulnerability stems from a problematic regular expression pattern {([#&+./;?]?)((?:[-\w%.]+(*|:\d+)?,?)+)} in the package's index.js file. The CVSS v3.1 base score is rated as 7.5 (HIGH) by NVD with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, while JFrog assigned a score of 5.9 (MEDIUM) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H. The vulnerability is classified under CWE-1333 (Inefficient Regular Expression Complexity) (NVD).

Impact

When exploited, this vulnerability can result in a total loss of availability through denial of service. The attack can cause the service to excessively consume CPU resources, leading to system unresponsiveness while the malicious input is being processed (Snyk Report).

Exploitability

A proof-of-concept exploit exists using the input pattern '{0' + '0'.repeat(1000)', which can trigger the exponential backtracking behavior in the regular expression engine. The vulnerability can be exploited remotely without requiring any privileges or user interaction (JFrog Advisory).

Mitigation and workarounds

The recommended mitigation is to upgrade uri-template-lite to version 22.9.0 or higher, which contains the fix for this vulnerability. The fix was implemented in a commit that addresses the potential ReDoS issue with invalid input (GitHub Commit).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2021-43309HIGH7.5
  • JavaScript logoJavaScript
  • uri-template-lite
NoYesAug 24, 2022
CVE-2022-24375HIGH7.5
  • JavaScript logoJavaScript
  • node-opcua
NoYesAug 24, 2022
CVE-2022-25231HIGH7.5
  • JavaScript logoJavaScript
  • node-opcua
NoYesAug 23, 2022
CVE-2022-21208HIGH7.5
  • JavaScript logoJavaScript
  • node-opcua
NoYesAug 23, 2022
CVE-2022-2932MEDIUM6.1
  • JavaScript logoJavaScript
  • mobiledoc-kit
NoYesAug 22, 2022

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management