total.js@3.0.0-72 vulnerabilities

MVC framework for Node.js

Direct Vulnerabilities

Known vulnerabilities in the total.js package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • C
Arbitrary Code Execution

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 Arbitrary Code Execution via the U.set() and U.get() functions.

PoC by Alessio Della Libera

const total = require('total.js');
U.set({}, 'a;let {mainModule}=process; let {require}=mainModule; let {exec}=require("child_process"); exec("touch HACKED")//');

NOTE: This vulnerability has also been identified as: CVE-2021-32831

How to fix Arbitrary Code Execution?

Upgrade total.js to version 3.4.9 or higher.

<3.4.9
  • C
Arbitrary Code Execution

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 Arbitrary Code Execution via the U.set() and U.get() functions.

PoC by Alessio Della Libera

const total = require('total.js');
U.set({}, 'a;let {mainModule}=process; let {require}=mainModule; let {exec}=require("child_process"); exec("touch HACKED")//');

NOTE: This vulnerability has also been identified as: CVE-2021-23389

How to fix Arbitrary Code Execution?

Upgrade total.js to version 3.4.9 or higher.

<3.4.9
  • M
Cross-site Scripting (XSS)

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 Cross-site Scripting (XSS) via themes/admin/views/index.html and themes/admin/public/ui.js.

How to fix Cross-site Scripting (XSS)?

Upgrade total.js to version 3.3.0-13 or higher.

<3.3.0-13
  • C
Remote Code Execution (RCE)

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

// To be run in a nodejs console:
require('total.js/utils').set({},'a;eval(`require("child_process")\\x2eexecSync("touch pwned")`);//')

How to fix Remote Code Execution (RCE)?

Upgrade total.js to version 3.4.8 or higher.

<3.4.8
  • H
Prototype Pollution

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 Prototype Pollution. The set function can be used to set a value into the object according to the path. However the keys of the path being set are not properly sanitized, leading to a prototype pollution vulnerability. The impact depends on the application. In some cases it is possible to achieve Denial of service (DoS), Remote Code Execution or Property Injection.

PoC

const total = require('total.js');
let obj = {};
console.log("Before : " + obj.polluted);
U.set({}, '__proto__.polluted', "yes");
console.log("After : " + obj.polluted);

How to fix Prototype Pollution?

Upgrade total.js to version 3.4.7 or higher.

<3.4.7
  • H
Command Injection

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 Command Injection. The issue occurs in the image.pipe and image.stream functions. The type parameter is used to build the command that is then executed using child_process.spawn. The issue occurs because child_process.spawn is called with the option shell set to true and because the type parameter is not properly sanitized.

PoC

const total = require('total.js');
let image = Image.load("");
let payload = ";touch HACKED;";
image.stream(payload);
// image.pipe(null, payload);

How to fix Command Injection?

Upgrade total.js to version 3.4.7 or higher.

<3.4.7
  • M
Directory Traversal

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 Directory Traversal due to req.uri.pathname not being validated within total.js framework.

How to fix Directory Traversal?

Upgrade total.js to version 3.3.3 or higher.

<3.3.3