Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use null prototype for userProperties #88

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

mcollina
Copy link
Member

It is a good security practice to set the prototype to null to avoid
adding methods such as hasOwnProperties that users could actually call.
Calling those methods directly might lead to a crash or an error.

See: https://github.com/nodejs/node/blob/e1edd6bbfab32bf95ee33532f1d4faaeafceb13c/lib/querystring.js#L262

It is a good security practice to set the prototype to null to avoid
adding methods such as hasOwnProperties that users could actually call.
Calling those methods directly might lead to a crash or an error.

See: https://github.com/nodejs/node/blob/e1edd6bbfab32bf95ee33532f1d4faaeafceb13c/lib/querystring.js#L262
@mcollina mcollina merged commit d902ca3 into master Aug 31, 2020
@mcollina mcollina deleted the use-null-prototype-for-user-properties branch August 31, 2020 10:40
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant