GHSL-2021-066: DoS and RCE in totaljs
The `utils.set` function in Total.js allows code injection when given user-controlled values, enabling an attacker to execute arbitrary JavaScript in the Node.js context. This can lead to denial of service or remote code execution.
Originally disclosed on GitHub Security Lab
Calling the utils.set function with user-controlled values leads to code-injection.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker can execute arbitrary JavaScript code in the context of Node.js, leading to denial of service or remote code execution.
What the attacker needed
User-controlled input passed to utils.set
How it was found
- Call `utils.set` with an object and a string containing malicious JavaScript code.
- The injected code is executed, causing an infinite loop (DoS) or running system commands (RCE).
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The Total.js framework has a function called `utils.set` that is used to set values on objects. If an attacker can control the input to this function, they can inject their own JavaScript code, which then runs on the server. This means the attacker could crash the server or run malicious commands.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.