-
-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of __proto__ seems discouraged #1169
Comments
Hello @icebob, I've just pushed a PR to fix this issue. |
@gautaz Ufff, this is a "prototype pollution" vulnerability. Thanks for your contribution! |
fix for #1169: getPrototypeOf instead of __proto__
Thanks! |
@icebob You're welcome! |
@gautaz Could you start Moleculer in Deno? |
Hello @icebob, yes !
With a simple test import { ServiceBroker } from "npm:[email protected]";
// Create a broker
const broker = new ServiceBroker();
// Create a service
broker.createService({
name: "math",
actions: {
add(ctx) {
return Number(ctx.params.a) + Number(ctx.params.b);
}
}
});
// Start broker
broker.start()
// Call service
.then(() => broker.call("math.add", { a: 5, b: 3 }))
.then(res => console.log("5 + 3 =", res))
.catch(err => console.error(`Error occurred! ${err.message}`)); |
Yeah this kind of project works, but I tried to start a project with Runner but it didn't work. |
Ah ok, I do not use the runner as I rely on kubernetes or swarm to manage my instances. |
Prerequisites
Current Behavior
Looking at
moleculer/src/service-broker.js
Lines 1777 to 1785 in 3e8fcef
It seems that the
ServiceBroker
code relies on__proto__
which seems to be discouraged from a security point of view.__proto__
is even unavailable ondeno
, see denoland/deno#4324.This means that
moleculer
currently cannot be used withnode --disable-proto=delete
ordeno
even with the latest addition of npm specifiers.Expected Behavior
The expectation is that
moleculer
runs with the--disable-proto
flag provided bynode
or evendeno
with npm specifiers.Failure Information
Currently with
node --disable-proto=delete
, the Moleculer microservice sample fails with:With
deno
:Steps to Reproduce
Please provide detailed steps for reproducing the issue.
node --disable-proto=delete
ordeno
Reproduce code snippet
See the Moleculer microservice sample.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs
See Failure Information.
The text was updated successfully, but these errors were encountered: