Vulnerabilities in pkg:npm/total.js

PACKAGE
Advisory Identifier: GHSA-3wj8-vp9h-rm6m
Advisory Summary

CVE-2021-23344 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Total.js libraries in the npm ecosystem. The issue involves total.js remote code execution vulnerability. Remediation is available by upgrading affected packages to version 3.4.8.

7 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/total.js

7 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/total.js. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-3wj8-vp9h-rm6m CVE-2021-23344 CRITICAL total.js Remote Code Execution Vulnerability
GHSA-6cf8-qhqj-vjqm CVE-2020-28495 HIGH Prototype pollution in total.js
GHSA-3q32-j57w-q4w7 CVE-2019-8903 HIGH Path Traversal in total.js
GHSA-vwhc-pww7-72x6 CVE-2021-32831 HIGH Code Injection in total.js
GHSA-4449-hg37-77v8 CVE-2020-28494 HIGH Command injection in total.js
GHSA-7fm6-gxqg-2pwr CVE-2021-23389 CRITICAL Code Injection in total.js
GHSA-72p5-2r6g-fm6v CVE-2019-10260 MODERATE Moderate severity vulnerability that affects total.js

CVE-2021-23344 at a Glance

CVE Identifier CVE-2021-23344
GHSA Identifier GHSA-3wj8-vp9h-rm6m
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Total.js
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2021-23344

To remediate this vulnerability, upgrade all affected Total.js dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

total.js fixed: 3.4.8
npm install total.js@3.4.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls total.js

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-23344, inspect your project dependencies using npm:

npm ls total.js

Analyze the terminal output to locate any version of Total.js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.4.8), your application is affected.

Note: The npm ls total.js command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Total.js, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

total.js is a framework for Node.js platfrom written in pure JavaScript similar to PHP's Laravel or Python's Django or ASP.NET MVC. It can be used as web, desktop, service or IoT application. Affected versions of this package are vulnerable to Remote Code Execution (RCE) via `set`. ### PoC ```js // To be run in a nodejs console: require('total.js/utils').set({}, 'a;eval(`require("child_process")\\x2eexecSync("touch pwned")`);//') ```

CVE-2021-23344 Affected Total.js Versions

1 component(s)
Fixed Versions:
3.4.8
Product / Package Ecosystem Affected Versions Fixed Version
total.js
npm
< 3.4.8
3.4.8

References

Frequently Asked Questions

What is CVE-2021-23344?
CVE-2021-23344 is a security vulnerability in Total.js involving total.js Remote Code Execution Vulnerability under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Total.js versions are affected?
Affected versions include releases prior to 3.4.8 across affected packages: total.js.
What version fixes CVE-2021-23344?
Upgrading to 3.4.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is total.js affected?
Yes, total.js is affected in releases prior to 3.4.8. Upgrade your dependency to 3.4.8 or later.
What is the CVSS score of CVE-2021-23344?
CVE-2021-23344 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-23344?
CVE-2021-23344 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2021-23344?
Run the dependency tree command: 'npm ls total.js'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3wj8-vp9h-rm6m",
  "modified" : "2023-09-13T20:23:10Z",
  "published" : "2021-03-19T21:32:20Z",
  "aliases" : [ "CVE-2021-23344" ],
  "summary" : "total.js Remote Code Execution Vulnerability",
  "details" : "total.js is a framework for Node.js platfrom written in pure JavaScript similar to PHP's Laravel or Python's Django or ASP.NET MVC. It can be used as web, desktop, service or IoT application.\n\nAffected versions of this package are vulnerable to Remote Code Execution (RCE) via `set`.\n\n### PoC\n```js\n// To be run in a nodejs console: \nrequire('total.js/utils').set({}, 'a;eval(`require(\"child_process\")\\\\x2eexecSync(\"touch pwned\")`);//')\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "total.js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.4.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 3.4.7"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23344"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/totaljs/framework/commit/c812bbcab8981797d3a1b9993fc42dad3d246f04"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-TOTALJS-1077069"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-03-12T22:42:43Z",
    "nvd_published_at" : "2021-03-04T17:15:00Z"
  }
}