Reflected Cross-Site Scripting Vulnerability in Adobe Magento Commerce

Title

Reflected Cross-Site Scripting (XSS)

Product

Adobe Magento Commerce

Vulnerable Version

< 2.4.2

Fixed Version

2.4.2

CVE Number

CVE-2021-21029

Impact

medium

Found

29.06.2020

By

Natsasit Jirathammanuwat (Office Thailand) | SEC Consult Vulnerability Lab

XSS vulnerabilities within Adobe Magento Commerce enable an attacker to perform unauthorized actions in the name of another logged-in user, and attack other users of the web application with JavaScript code, browser exploits or Trojan horses.

Vendor Description

"Magento Commerce, offers a one-of-a-kind eCommerce solution with enterprise power, unlimited scalability, and open-source flexibility for B2C and B2B experiences. Magento allows you to create unique, full-lifecycle customer experiences proven to generate more sales. No matter what your company’s size or goals — omnichannel, global expansion, mobile — Magento delivers everything you need for growth in an increasingly competitive market."

Source: https://magento.com/products

Business Recommendation

Update to the latest version of Adobe Magento Commerce. An in-depth security analysis performed by security professionals is highly advised, as the software may be affected from further security issues.

Vulnerability Overview / Description

1) Reflected Cross-Site Scripting (XSS) (CVE-2021-21029)

This vulnerability allows an unauthenticated user to inject malicious client side script into the URL and send to the victim. The browser may redirect the victim (e.g. admin) to the frontend page when visiting the URL, the script will be executed after the victim visits the admin panel again.

This vulnerability has two different scenarios:

1. Security configuration "Add Secret Key to URLs" is enabled (default)

  • Admin panel path is required.
  • Key value (secret hash) in the URL is required.
  • User interaction is required (navigate back to the admin panel).

2. Security configuration "Add Secret Key to URLs" is disabled.

  • Admin panel path is required.
  • User interaction is required (navigate back to the admin panel).

Proof Of Concept

1) Reflected Cross-Site Scripting (XSS) (CVE-2021-21029)

The "file" parameter is vulnerable to reflected cross-site scripting vulnerability. By sending the XSS payload in the Base64 encoded format in the URL as follows:

1. Security configuration "Add Secret Key to URLs" is enabled (default)

URL format: 

{baseURL}/{adminPath}/admin/system_design_theme/downloadCss/theme_id/{themeID}/file/{base64encoded_xss_payload}/key/{secret_hash}&nbsp;

Example URL:

127.0.0.1/index.php/admin/admin/system_design_theme/downloadCss/theme_id/1/file/PHNjcmlwdD5hbGVydCgnWFNTIGJ5IFNFQyBDb25zdWx0Jyk8L3NjcmlwdD4%3D/key/0f5d20e8559bb6f45e4840ceb6231870f3a8fe122698b37c32ceabbb33595813&nbsp;

2) Security configuration "Add Secret Key to URLs" is disabled.

URL format:

{baseURL}/{adminPath}/admin/system_design_theme/downloadCss/theme_id/{themeID}/file/{base64encoded_xss_payload}/

Example URL:

127.0.0.1/index.php/admin/admin/system_design_theme/downloadCss/theme_id/1/file/PHNjcmlwdD5hbGVydCgnWFNTIGJ5IFNFQyBDb25zdWx0Jyk8L3NjcmlwdD4%3D/

Vulnerable / Tested Versions

Magento2 version 2.3.5-p1 has been tested, which was the latest version available at the time of the test. Previous versions may also be affected. Later versions until the patched version v2.4.2 are affected as well.

Vendor Contact Timeline

2020-07-09 Contacting vendor through https://hackerone.com/magento.
2020-07-09 The report is flagged as out-of-scope in hackerone.
2020-08-13 Contacting vendor and requesting encryption key through psirt@adobe.com.
2020-08-13 Vendor provides PGP encryption key.
2020-08-14 Sending encrypted advisory to the vendor.
2020-09-09 Asking vendor for a status update.
2020-09-10 Vendor is still investigating the issue.
2020-09-28 Asking vendor for a status update.
2020-10-02 Vendor is still investigating the issue.
2020-11-24 Asking vendor for a status update.
2020-11-24 Vendor is planing to fix the issue in next release.
2021-02-02 Asking vendor for a status update and the release date.
2021-02-02 Vendor is planing to release a security update on February 9th.
2021-02-10 Coordinated release of security advisory.

Solution

Update to the latest available version v2.4.2 of Magento2 from the vendor's download page: https://magento.com/tech-resources/download

Vendor security advisory: https://helpx.adobe.com/security/products/magento/apsb21-08.html

 

Workaround

None

 

Advisory URL

https://sec-consult.com/vulnerability-lab/

 

EOF N. Jirathammanuwat / @2021