SEC Consult SA-20210210-0 :: Reflected Cross-Site Scripting in Adobe Magento Commerce

Related Vulnerabilities: CVE-2021-21029  
                							

                <!--X-Body-Begin-->
<!--X-User-Header-->
<a href="/fulldisclosure/"><img src="/images/fulldisclosure-logo.png" class="l-logo right" alt="fulldisclosure logo" width="80"></a>
<h2 class="m-list"><a href="/fulldisclosure/">Full Disclosure</a>
mailing list archives</h2>
<!--X-User-Header-End-->
<!--X-TopPNI-->
<div class="nav-bar">
<div class="nav-link">
<a href="34"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#35">By Date</a>
<a href="36"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="34"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#35">By Thread</a>
<a href="36"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<form class="nst-search center" action="/search/fulldisclosure">
<input class="nst-search-q" name="q" type="search" placeholder="List Archive Search">
<button class="nst-search-button" title="Search">
<img style="width:100%;aspect-ratio:1/1;" alt="" aria-hidden="true" src="/shared/images/nst-icons.svg#search">
</button>
</form>

</div>

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<h1 class="m-title">SEC Consult SA-20210210-0 :: Reflected Cross-Site Scripting in Adobe Magento Commerce</h1>
<hr>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->


<em>From</em>: SEC Consult Vulnerability Lab &lt;research () sec-consult com&gt;


<em>Date</em>: Wed, 10 Feb 2021 14:53:43 +0100


<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<hr>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<pre style="margin: 0em;">SEC Consult Vulnerability Lab Security Advisory &lt; 20210210-0 &gt;
=======================================================================
              title: Reflected Cross-Site Scripting (XSS)
            product: Adobe Magento Commerce
 vulnerable version: &lt; 2.4.2
      fixed version: 2.4.2
         CVE number: CVE-2021-21029
             impact: Medium
           homepage: <a rel="nofollow" href="https://magento.com/">https://magento.com/</a>
              found: 2020-06-29
                 by: Natsasit Jirathammanuwat (Office Thailand)
                     SEC Consult Vulnerability Lab

                     An integrated part of SEC Consult, an Atos company
                     Europe | Asia | North America

                     <a rel="nofollow" href="https://www.sec-consult.com">https://www.sec-consult.com</a>

=======================================================================

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: <a rel="nofollow" href="https://magento.com/products">https://magento.com/products</a>


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:
<a rel="nofollow" href="https://{baseURL}/{adminPath}/admin/system_design_theme/downloadCss/theme_id/{themeID}/file/{base64encoded_xss_payload}/key/{secret_hash}">https://{baseURL}/{adminPath}/admin/system_design_theme/downloadCss/theme_id/{themeID}/file/{base64encoded_xss_payload}/key/{secret_hash}</a>
Example URL:
<a rel="nofollow" href="https://127.0.0.1/index.php/admin/admin/system_design_theme/downloadCss/theme_id/1/file/PHNjcmlwdD5hbGVydCgnWFNTIGJ5IFNFQyBDb25zdWx0Jyk8L3NjcmlwdD4%3D/key/0f5d20e8559bb6f45e4840ceb6231870f3a8fe122698b37c32ceabbb33595813">https://127.0.0.1/index.php/admin/admin/system_design_theme/downloadCss/theme_id/1/file/PHNjcmlwdD5hbGVydCgnWFNTIGJ5IFNFQyBDb25zdWx0Jyk8L3NjcmlwdD4%3D/key/0f5d20e8559bb6f45e4840ceb6231870f3a8fe122698b37c32ceabbb33595813</a>

2. Security configuration "Add Secret Key to URLs" is disabled.
URL format:
<a rel="nofollow" href="https://{baseURL}/{adminPath}/admin/system_design_theme/downloadCss/theme_id/{themeID}/file/{base64encoded_xss_payload}/">https://{baseURL}/{adminPath}/admin/system_design_theme/downloadCss/theme_id/{themeID}/file/{base64encoded_xss_payload}/</a>
Example URL:
<a rel="nofollow" href="https://127.0.0.1/index.php/admin/admin/system_design_theme/downloadCss/theme_id/1/file/PHNjcmlwdD5hbGVydCgnWFNTIGJ5IFNFQyBDb25zdWx0Jyk8L3NjcmlwdD4%3D/">https://127.0.0.1/index.php/admin/admin/system_design_theme/downloadCss/theme_id/1/file/PHNjcmlwdD5hbGVydCgnWFNTIGJ5IFNFQyBDb25zdWx0Jyk8L3NjcmlwdD4%3D/</a>


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 <a rel="nofollow" href="https://hackerone.com/magento">https://hackerone.com/magento</a>.
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:
<a rel="nofollow" href="https://magento.com/tech-resources/download">https://magento.com/tech-resources/download</a>

Vendor security advisory:
<a rel="nofollow" href="https://helpx.adobe.com/security/products/magento/apsb21-08.html">https://helpx.adobe.com/security/products/magento/apsb21-08.html</a>


Workaround:
-----------
None


Advisory URL:
-------------
<a rel="nofollow" href="https://sec-consult.com/vulnerability-lab/">https://sec-consult.com/vulnerability-lab/</a>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SEC Consult Vulnerability Lab

SEC Consult, an Atos company
Europe | Asia | North America

About SEC Consult Vulnerability Lab
The SEC Consult Vulnerability Lab is an integrated part of SEC Consult, an
Atos company. It ensures the continued knowledge gain of SEC Consult in the
field of network and application security to stay ahead of the attacker. The
SEC Consult Vulnerability Lab supports high-quality penetration testing and
the evaluation of new offensive and defensive technologies for our customers.
Hence our customers obtain the most current information about vulnerabilities
and valid recommendation about the risk profile of new technologies.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interested to work with the experts of SEC Consult?
Send us your application <a rel="nofollow" href="https://sec-consult.com/career/">https://sec-consult.com/career/</a>

Interested in improving your cyber security with the experts of SEC Consult?
Contact our local offices <a rel="nofollow" href="https://sec-consult.com/contact/">https://sec-consult.com/contact/</a>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mail: research at sec-consult dot com
Web: <a rel="nofollow" href="https://www.sec-consult.com">https://www.sec-consult.com</a>
Blog: <a rel="nofollow" href="http://blog.sec-consult.com">http://blog.sec-consult.com</a>
Twitter: <a rel="nofollow" href="https://twitter.com/sec_consult">https://twitter.com/sec_consult</a>

EOF N. Jirathammanuwat / @2021

</pre><p><strong>Attachment:
<a href="att-35/smime_p7s.bin"><tt>smime.p7s</tt></a></strong>

<em>Description:</em> S/MIME Cryptographic Signature</p>
<pre style="margin: 0em;">
_______________________________________________
Sent through the Full Disclosure mailing list
<a rel="nofollow" href="https://nmap.org/mailman/listinfo/fulldisclosure">https://nmap.org/mailman/listinfo/fulldisclosure</a>
Web Archives &amp; RSS: <a rel="nofollow" href="http://seclists.org/fulldisclosure/">http://seclists.org/fulldisclosure/</a></pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<div class="nav-bar">
<div class="nav-link">
<a href="34"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="date.html#35">By Date</a>
<a href="36"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
<div class="nav-link">
<a href="34"><img src="/images/left-icon-16x16.png" alt="Previous" width="16" height="16"></a>
<a href="index.html#35">By Thread</a>
<a href="36"><img src="/images/right-icon-16x16.png" alt="Next" width="16" height="16"></a>
</div>
</div>
<h3 class="m-thread">Current thread:</h3>
<ul class="thread">
<li><strong>SEC Consult SA-20210210-0 :: Reflected Cross-Site Scripting in Adobe Magento Commerce</strong> <em>SEC Consult Vulnerability Lab (Feb 10)</em>
</li></ul>


<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<p>