CVE-2021-4305
JavaScript vulnerability analysis and mitigation

Overview

A vulnerability was discovered in Woorank robots-txt-guard affecting the makePathPattern function in lib/patterns.js. The vulnerability (CVE-2021-4305) relates to inefficient regular expression complexity, where manipulation of the pattern argument could lead to potential issues. The vulnerability was publicly disclosed and has been assigned a CVSS 3.1 base score of 7.5 (HIGH) by NVD (NVD).

Technical details

The vulnerability stems from the way the makePathPattern function handles pattern splitting, which could result in inefficient regular expression complexity. The issue specifically occurs when processing patterns with multiple asterisks, which could be transformed into resource-intensive regular expressions. The vulnerability has been assigned CWE-1333 (Inefficient Regular Expression Complexity). The CVSS vector string is CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (NVD).

Impact

When exploited, the vulnerability could lead to performance issues due to inefficient regular expression processing. For example, a pattern like '/*.js$' would be transformed into a complex regex that takes seconds to execute, whereas a simpler pattern could achieve the same result more efficiently (GitHub PR).

Mitigation and workarounds

A patch has been released with commit ID c03827cd2f9933619c23894ce7c98401ea824020. The fix involves modifying the pattern splitting mechanism to use '/*+/' instead of '*', preventing the creation of inefficient regular expressions. It is recommended to update to version 1.0.0 or later of the robots-txt-guard package (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-2025-65959HIGH8.7
  • JavaScriptJavaScript
  • open-webui
NoYesDec 04, 2025
CVE-2025-66032HIGH8.7
  • JavaScriptJavaScript
  • @anthropic-ai/claude-code
NoYesDec 03, 2025
CVE-2025-65945HIGH7.5
  • JavaScriptJavaScript
  • jws
NoYesDec 04, 2025
CVE-2025-66404MEDIUM6.4
  • JavaScriptJavaScript
  • mcp-server-kubernetes
NoYesDec 03, 2025
CVE-2025-66479LOW1.8
  • JavaScriptJavaScript
  • @anthropic-ai/sandbox-runtime
NoYesDec 04, 2025

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