CVE-2021-4305: robots-txt-guard Inefficient Regular Expression Complexity vulnerability
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.1613%
CWE
Published
1/5/2023
Updated
1/27/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
robots-txt-guard | npm | < 1.0.2 | 1.0.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability report explicitly identifies makePathPattern in lib/patterns.js as the affected function. The commit diff shows the fix changed the splitting logic from .split('') to .split(/*+/), which collapses consecutive asterisks. This confirms the original implementation created inefficient regex patterns by splitting on every individual '' character, creating redundant quantifiers. The added test case with '/*****************************************************************************.js$' demonstrates the ReDoS scenario the patch addresses.