Miggo Logo

CVE-2022-1243: Incorrect protocol extraction via \r, \n and \t characters

7.2

CVSS Score
3.0

Basic Information

EPSS Score
0.54305%
Published
4/6/2022
Updated
11/29/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
urijsnpm< 1.19.111.19.11

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from URI.parse()'s handling of URL parsing. The commit fix shows:

  1. Addition of a regex pattern (ascii_tab_whitespace) to detect control characters
  2. Modification of the parsing logic to strip these characters from input strings
  3. Test cases added for URLs containing CR/LF/TAB in protocols This demonstrates the vulnerable function was URI.parse() as it previously didn't sanitize these characters, allowing protocol confusion. The direct correlation between the vulnerability description and the patched code changes confirms this assessment.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

\r, \n *n* \t ***r**t*rs in us*r-input URLs **n pot*nti*lly l*** to in*orr**t proto*ol *xtr**tion w**n usin* npm p**k*** urijs prior to v*rsion *.**.**. T*is **n l*** to XSS w**n t** mo*ul* is us** to pr*v*nt p*ssin* in m*li*ious j*v*s*ript: links i

Reasoning

T** vuln*r**ility st*ms *rom URI.p*rs*()'s **n*lin* o* URL p*rsin*. T** *ommit *ix s*ows: *. ***ition o* * r***x p*tt*rn (*s*ii_t**_w*it*sp***) to **t**t *ontrol ***r**t*rs *. Mo*i*i**tion o* t** p*rsin* lo*i* to strip t**s* ***r**t*rs *rom input st