-
Notifications
You must be signed in to change notification settings - Fork 479
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
fix: Security bug about prototype pollution #805
fix: Security bug about prototype pollution #805
Conversation
1b8adb7
to
67e03cb
Compare
|
Object.prototype.MAL_CODE= [ malicious ]; | ||
const compiled = dust.compile('{username} is an important person.{~n}'); | ||
const tmpl = dust.loadSource(compiled); | ||
dust.render(tmpl, { username: 'Jane Doe' }, (err, output) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how did we test this?
what should be the result of this test without the above fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will execute curl 127.0.0.1
and the test fails
67e03cb
to
ddb6523
Compare
@@ -70,6 +70,9 @@ | |||
type = type || INFO; | |||
if (loggingLevels[type] >= loggingLevels[dust.debugLevel]) { | |||
log('[DUST:' + type + ']', message); | |||
if (type === ERROR && dust.debugLevel === DEBUG && message instanceof Error && message.stack) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were errors just logging [Object] or something like that before this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generated file.
The primary code change I added is in https://github.com/linkedin/dustjs/pull/805/files#diff-544803892ac752aa674ffa81380c022af562eda776860d94eb5c2d3bdb59c99c
Refer #804