Implement a __proto__ check option
See original GitHub issueEran Hammer posted an article on proto poisoning and his solution in joi/hapi: https://hueniverse.com/a-tale-of-prototype-poisoning-2610fa170061
@rgrove posted a simple implementation of a fix for this: https://gist.github.com/rgrove/3ea9421b3912235e978f55e291f19d5d
However the fix requires a custom reviver that might slow down the default/valid parsing case, Eran prevented this by using an initial check for __proto__
. It might be good to add this as a default to be checked for in body-parser in general that can be switched off… if someone wants to do so.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Language Guide | Protocol Buffers - Google Developers
proto files, use C/C++-style // and /* ... */ syntax. /* SearchRequest represents a search query, with pagination options ...
Read more >How To Implement Field Presence for Proto3 - GitHub
Proto3 descriptors already use LABEL_OPTIONAL for proto3 singular fields, ... --experimental_allow_proto3_optional # Another option: $ cp test.proto ...
Read more >[protobuf] How to handle options in compiler plugin?
Also, are there some test proto files, with binary data, which I can use to ... show us the .proto code you are...
Read more >Protocol Buffers for (Coding) Dummies - GitHub Pages
Long answer: You technically have other options for data serialization. ... Help, I have multiple directories to search for .proto files in.
Read more >Working with Proto DataStore - Android Developers
To learn hands-on how to use Preferences DataStore, check out this codelab. What you'll learn. What DataStore is and why you should use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dougwilson I would personally like to see a prototype pollution protection added to express. I doubt there are many legitimate uses of
__proto__
andconstructor
properties in requests parsed by body-parser, and removing them in a new version sounds like an worthy improvement to me. I do some input sanitation in my code, and then sometimes I let external libraries do it (such as sequelize with type validation). I don’t feel like checking if these libraries are doing the right thing related to prototype pollution, but I would sleep better knowing that even if they don’t handle it right, express will catch this issue before.@rgrove unless if I’m misunderstanding the docs incorrectly, can’t the Bourne check also be done within the body-parser middleware w/o the need to add a bespoke one after body-parser.json()?