Miggo Logo

CVE-2017-16224: Open Redirect in st

6.1

CVSS Score
3.0

Basic Information

EPSS Score
0.44225%
Published
8/6/2018
Updated
9/11/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
stnpm<= 1.2.11.2.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key functions:

  1. getPath directly processed user-supplied paths using path.join() without sufficient validation for encoded traversals. The patch shows this was replaced with getUriPath containing improved regex checks (/(/|\|^)..?(/|\|$)/).
  2. serve initially parsed the URL path without validation. The patch shows it was modified to use getUriPath first. In vulnerable versions, these functions would appear in stack traces when processing malicious //domain/%2e%2e requests:
  • serve() would handle the incoming request
  • getPath() would process the untrusted path Together they allowed crafting Location headers with external domains due to insufficient path normalization and validation.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

st is * mo*ul* *or s*rvin* st*ti* *il*s. *n *tt**k*r is **l* to *r**t * r*qu*st t**t r*sults in *n `*TTP ***` (r**ir**t) to *n *ntir*ly *i***r*nt *om*in. * r*qu*st *or: `*ttp://som*.s*rv*r.*om//no**s**urity.or*/%**%**` woul* r*sult in * *** to `//

Reasoning

T** vuln*r**ility st*ms *rom two k*y *un*tions: *. **tP*t* *ir**tly pro**ss** us*r-suppli** p*t*s usin* p*t*.join() wit*out su**i*i*nt v*li**tion *or *n*o*** tr*v*rs*ls. T** p*t** s*ows t*is w*s r*pl**** wit* **tUriP*t* *ont*inin* improv** r***x ****