Skip to content
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

grpc: Fix prototype pollution possibility in loadPackageDefinition #1701

Merged

Conversation

@murgatroid99
Copy link
Member

@murgatroid99 murgatroid99 commented Feb 24, 2021

This is a port of #1654 to the old grpc library.

Credit to @d3v53c for the original fix.

@murgatroid99 murgatroid99 requested a review from nicolasnoble Feb 24, 2021
@d3v53c
Copy link
Contributor

@d3v53c d3v53c commented Feb 25, 2021

Hi @murgatroid99 , @nicolasnoble ,

I've tried to improve the fix a little more by using indexOf instead of includes. Please have a look at the implementations.

  1. PR-1
  2. PR-2

Cheers!

@murgatroid99
Copy link
Member Author

@murgatroid99 murgatroid99 commented Feb 25, 2021

Are the changes in this PR incorrect in some way? Or, in other words, why specifically do you consider the PRs you linked improvements over this one?

@d3v53c
Copy link
Contributor

@d3v53c d3v53c commented Feb 27, 2021

Are the changes in this PR incorrect in some way? Or, in other words, why specifically do you consider the PRs you linked improvements over this one?

Sorry for the late reply.

The changes are correct when considering the newer versions of JavaScript. The Array.prototype.includes is only introduced in ECMAScript 2016 version.
Since, we're looking at an old library and for the sake of compatibility on older versions, it'd probably be better to fallback to Array.prototype.indexOf implementations. Please feel free to correct me if I'm wrong.

Cheers!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants