Miggo Logo

CVE-2020-8823: Cross-site scripting in SocksJS-node

6.1

CVSS Score
3.1

Basic Information

EPSS Score
0.72308%
Published
4/13/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
sockjsnpm< 0.3.00.3.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability exists in the htmlfile transport handler which directly embedded the 'c' callback parameter into HTML output without proper sanitization. While the provided GitHub commit shows routing changes, the actual vulnerability is documented in external references showing:

  1. The htmlfile.js transport lacked input validation for the callback parameter
  2. The function wrote user-controlled input directly into the response via iframe_template.replace(/{{ callback }}/g, callback)
  3. The patched version added a regex check for allowed characters in the callback parameter This function would appear in runtime profiles when handling /htmlfile requests with malicious 'c' parameters.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*tml*il* in li*/tr*nsport/*tml*il*.js in So*kJS ***or* *.*.* is vuln*r**l* to R**l**t** XSS vi* t** /*tml*il* * (*k* **ll***k) p*r*m*t*r.

Reasoning

T** vuln*r**ility *xists in t** *tml*il* tr*nsport **n*l*r w*i** *ir**tly *m****** t** '*' **ll***k p*r*m*t*r into *TML output wit*out prop*r s*nitiz*tion. W*il* t** provi*** *it*u* *ommit s*ows routin* ***n**s, t** **tu*l vuln*r**ility is *o*um*nt**