magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Magento 2 using a jQuery version with known vulnerabilities #26547

Closed valugi closed 4 years ago

valugi commented 4 years ago

Preconditions (*)

  1. Magento EE ver. 2.2.8
  2. I see that 2.3.x is using the same version of jQuery

Steps to reproduce (*)

  1. Install Magento
  2. check jQuery version that is packed with it

Expected result (*)

  1. Have a newer version of jQuery, possibly the latest
  2. Maybe having a mechanism of updating jQuery independently

Actual result (*)

  1. A security scan shows that the version of jQuery has known vulnerabilities:
    • jQuery 1.12.4
    • jQuery UI 1.10.4
m2-assistant[bot] commented 4 years ago

Hi @valugi. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@valugi do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


m2-assistant[bot] commented 4 years ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 4 years ago

Hello @sdzhepa

This issue looks like a feature request, can you please move this to a propper repository?

Thank you

valugi commented 4 years ago

hi @engcom-Bravo, If you treat this as a feature request it will be implemented only for the future versions. But this is a bug - a security bug - for the existing versions and should be patched in 2.2 and 2.3, not in 2.4 or above. Regards

m2-assistant[bot] commented 4 years ago

Hi @sdzhepa. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

duffner commented 4 years ago

@magento-engcom-team, this is a security issue. While this ticket, could use some improved documentation, Google itself recognizes this as a security flaw. This blantent notice looks bad for Magento. While I don’t agree it should be ported back to 2.2 versions, I do believe it should be in 2.3 as this issue presented itself in 2.3 and I’d like to see us move forward.

onepack commented 4 years ago

I cannot believe this is still open. Please update asap.

DanielRuf commented 4 years ago
1. A security scan shows that the version of jQuery has known vulnerabilities:

* jQuery 1.12.4

This was patched directly in the file.

I guess you mean this and a few others: https://github.com/magento/magento2/pull/22418

DanielRuf commented 4 years ago
1. Have a newer version of jQuery, possibly the latest

The newer releases break existing code.

DanielRuf commented 4 years ago

Also see https://github.com/magento/magento2/commit/86fdea32b19df148a4eeaad0f81bd0db68dc0cef#diff-13e016f05effe828e3d5ababa4a62a15

As no details were provided about the exact problem (which CVE IDs are not fixed in our version) I think we can close this for now.

Still, most of the code still relies on jQuery 1.x and I think there were some PRs to make code compatible with jQuery 3 but would be a breaking change then.

Additionally I host patched versions at https://github.com/DanielRuf/snyk-js-jquery-174006/ and https://github.com/DanielRuf/snyk-js-jquery-565129

Eddcapone commented 3 years ago

Q2 2021 and Magento 2.4.2 still uses jQuery 1

onepack commented 3 years ago

Magento 2.4.2-p1. Quick Lighthouse scan:

Library Version Vulnerability Count Highest Severity
jQuery@1.12.4 4 Medium
jQuery UI@1.10.4 1 High
onepack commented 3 years ago

Make it a core setting in the backend or env: Required jQuery version: 1/ 2/ 3 Required jQuery UI version: etc. New stores can go for the newer versions of jquery. Older shops with older themes and functionality that would break keep it v1.

DanielRuf commented 3 years ago

Magento 2.4.2-p1. Quick Lighthouse scan:

Lighthouse outputs these depending on the detected version number. It does not detect the manual changes in the jQuery files. Please check the files in the repo, in your projekt and see my last comments regarding the fixed problems.

onepack commented 3 years ago

@DanielRuf Thanks. I will check. Do you think this would affect SEO results as Google sees it as a high risk. Their system doesn't notice the patches.

DanielRuf commented 3 years ago

Do you think this would affect SEO results as Google sees it as a high risk.

No, I don't think so. Security itself has nothing to do with offsite or onsite SEO and I am not aware of any penalties due to outdated and insecure libraries.

DanielRuf commented 3 years ago

Their system doesn't notice the patches.

Correct, because Lighthouse just checks library name + library version and compares it with a table of known vulnerable versions (from Snyk).

See: https://github.com/GoogleChrome/lighthouse/blob/2511725963e8695c302095f68cc5f6a1bc393bd2/package.json#L170 https://www.npmjs.com/package/js-library-detector https://github.com/GoogleChrome/lighthouse/issues/10412