Miggo Logo

CVE-2021-23344:
total.js Remote Code Execution Vulnerability

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.90758%
Published
3/19/2021
Updated
9/13/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
total.jsnpm< 3.4.73.4.8

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

  1. The PoC demonstrates RCE via require('total.js/utils').set()
  2. The GitHub commit shows security improvements in utils.js's set function
  3. The patch adds 'eval' to the regex pattern check, indicating it was previously allowed
  4. The vulnerable code uses new Function() with unsanitized input containing semicolons to chain expressions
  5. CWE-94 (Code Injection) directly maps to unsafe code generation in set()

Vulnerable functions

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

WAF Protection Rules

WAF Rule

tot*l.js is * *r*m*work *or No**.js pl*t*rom writt*n in pur* J*v*S*ript simil*r to P*P's L*r*v*l or Pyt*on's *j*n*o or *SP.N*T MV*. It **n ** us** *s w**, **sktop, s*rvi** or IoT *ppli**tion. *****t** v*rsions o* t*is p**k*** *r* vuln*r**l* to R*mot

Reasoning

*. T** Po* **monstr*t*s R** vi* r*quir*('tot*l.js/utils').s*t() *. T** *it*u* *ommit s*ows s**urity improv*m*nts in utils.js's s*t *un*tion *. T** p*t** ***s '*v*l' to t** r***x p*tt*rn ****k, in*i**tin* it w*s pr*viously *llow** *. T** vuln*r**l* *o