Miggo Logo

CVE-2021-21322: Prefix escape

10

CVSS Score
3.1

Basic Information

EPSS Score
0.68505%
Published
3/3/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
fastify-http-proxynpm< 4.3.14.3.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from two key issues: 1) createWebSocketUrl's improper path construction that didn't validate the request path against the configured prefix, allowing path manipulation. 2) setupWebSocketProxy's missing initial prefix check for WebSocket connections. The commit 02d9b43 adds both the prefix validation check in setupWebSocketProxy and fixes the path rewriting logic in createWebSocketUrl, confirming these were the vulnerable components. The CWE-20 mapping further supports the input validation failure context.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t *y *r**tin* * sp**i*i* URL, it is possi*l* to *s**p* t** pr**ix o* t** proxi** ***k*n* s*rvi**. I* t** **s* url o* t** proxi** s*rv*r is `/pu*/`, * us*r *xp**t t**t ****ssin* `/priv` on t** t*r**t s*rvi** woul* not ** possi*l*. Un*ortun*t

Reasoning

T** vuln*r**ility st*mm** *rom two k*y issu*s: *) `*r**t*W**So*k*tUrl`'s improp*r p*t* *onstru*tion t**t *i*n't `v*li**t*` t** r*qu*st p*t* ***inst t** *on*i*ur** pr**ix, *llowin* p*t* m*nipul*tion. *) `s*tupW**So*k*tProxy`'s missin* initi*l pr**ix *