-
Notifications
You must be signed in to change notification settings - Fork 206
Description
👋 I know this repo is probably no longer maintained - I'm opening this issue for others out there on the internet who still might be using $.deparam
and care about this sort of thing. You can grab the fix in my PR here: #61
To be clear also: If you care about security/prototype pollution and using jQuery BBQ, you should be on jQuery 3.4.0+ (and using one of the open PRs to enable jQuery 3 compatibility, e.g. #48 or #42). Otherwise you'll still be vulnerable to pollution via $.extend
.
If you're continuing to use jQuery BBQ in production, I recommend maintaining your own fork with #48 and #61 merged/cherry-picked. You'll have to uglify/compress your own final output, but there are online YUI compressors you can easily use.
Reproducing
To see the prototype pollution in action:
- http://benalman.com/code/projects/jquery-bbq/examples/deparam/?__proto__[test]=polluted
- http://benalman.com/code/projects/jquery-bbq/examples/deparam/?someObj[__proto__][test]=polluted
- Open your browser console and enter
({}).test
. Note that it now outputs "polluted".
- Open your browser console and enter
Why does it matter?
Check the following more malicious examples:
- http://benalman.com/code/projects/jquery-bbq/examples/deparam/?__proto__[hasOwnProperty]=true
- We've hijacked
.hasOwnProperty
for every single obj instance on the page.
- We've hijacked
- http://benalman.com/code/projects/jquery-bbq/examples/deparam/?__proto__[test]=alert(%27hi%27)
- Run
eval({}.test)
in your console - this is a potential XSS vector for sites that eval() on user parameters (hopefully none or very few).
- Run