-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Patch the prototype pollution vulnerability in jQuery < 3.4.0 (CVE-2019-11358) #22418
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
Conversation
Hi @DanielRuf. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
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.
@DanielRuf it is not so easy to review a minified file, you know :)
Please provide exact steps so that resulting file can be verified.
Hi, I have only changed the part directly before The blog article by Snyk contains some examples: https://snyk.io/blog/after-three-years-of-silence-a-new-jquery-prototype-pollution-vulnerability-emerges-once-again/ |
By using jsbeautify or any other beautifier it should be possible to see the single change. The patch files are also linked by the jQuery team in their blog post about the 3.4.0 release. |
@DanielRuf thanks, this should work as well. I was thinking of applying UglifyJS or whatever tool you used the same way you did it. I didn't think you edited minified file directly :) Should we specify additional patch in comment maybe? |
Can you specify what you mean? |
Another header comment which would be strippable in production mode (copyright-containing comments are probably not strippable). |
Done. Please review the changes. |
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.
@DanielRuf, /*!
no exclamation mark in patch comment so that it can be stripped.
Diff LGTM:
- for (d in e) a = g[d], c = e[d], g !== c && (j && c && (n.isPlainObject(c) || (b = n.isArray(c))) ? (b ? (b = !1, f = a && n.isArray(a) ? a : []) : f = a && n.isPlainObject(a) ? a : {}, g[d] = n.extend(j, f, c)) : void 0 !== c && (g[d] = c));
+ for (d in e) a = g[d], c = e[d], d !== "__proto__" && g !== c && (j && c && (n.isPlainObject(c) || (b = n.isArray(c))) ? (b ? (b = !1, f = a && n.isArray(a) ? a : []) : f = a && n.isPlainObject(a) ? a : {}, g[d] = n.extend(j, f, c)) : void 0 !== c && (g[d] = c));
Please squash into single commit after last change.
Ok, I will change it and squash the commits. |
Done. |
Hi @orlangur, thank you for the review. |
Any update? Would be good to have this fixed and as SUPEE patch or link to my patches at https://github.com/DanielRuf/snyk-js-jquery-174006 |
@sdzhepa @stoleksiy @VasylShvorak sorry for pinging directly, could you please proceed with this PR? |
Hello Thank you for contribution and collaboration! During testing, I faced an issue. Manual testing scenario:
Result on 2.3-develop branch: true Result on branch with fix: The same as on 2.3-develop - true |
Hi @sdzhepa, Would be new for me that the patch would not work. I will check it again tomorrow but the replaced part should be correct. |
See https://github.com/DanielRuf/snyk-js-jquery-174006/blob/master/jquery-1.12.4.patch and the minified version, these should be the same. |
@magento-engcom-team give me test instance |
Hi @VladimirZaets. Thank you for your request. I'm working on Magento instance for you |
Your file does not seem to contain the fix. |
Seems this is a different jQuery file, see the comment at the top. https://github.com/DanielRuf/magento2/blob/e0cc1c98ebf326183b1e533df52bc97774df8141/lib/web/jquery/jquery.min.js#L1 |
https://github.com/magento/magento2/search?utf8=✓&q=includes+sizzle&type= Wait, why do we have jQuery twice? |
Ok so 98214d7 removed the minified file and changed the imports and ebbccca added the minified file again. Not sure why, also the move out of the jquery folder was probably not the best idea. I will patch the other file too. We should discuss this in another issue if we should revert the changes and remove the duplicated file(s). |
Hi @orlangur, thank you for the review. |
Hi @DanielRuf, thank you for your contribution! |
[borg] MC-22172: {Backport for 2.2.x }Patch the prototype pollution vulnerability in jQuery < 3.4.0 #22418
This patches the prototype pollution vulnerability in jQuery < 3.4.0.
See https://blog.jquery.com/2019/04/10/jquery-3-4-0-released/
Patches: https://github.com/DanielRuf/snyk-js-jquery-174006?files=1
Original report: https://app.snyk.io/vuln/SNYK-JS-JQUERY-174006
Description (*)
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)