Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

CVE-2020-5776, CVE-2020-5777: Multiple Vulnerabilities in the MAGMI Magento Mass Import Plugin

Tenable Research discovers multiple vulnerabilities in the MAGMI Magento plugin that could lead to remote code execution on a vulnerable Magento site.

Background

On September 1, we published TRA-2020-51, a Tenable Research Advisory for two vulnerabilities in the Magento Mass Import (MAGMI) plugin. These vulnerabilities were discovered by Enguerran Gillier of the Tenable Web Application Security Team. MAGMI is a Magento database client written in PHP, which is used to perform raw bulk operations on the models of an online store. Our research into these vulnerabilities follows an FBI flash security alert that became public in May 2020 regarding in-the-wild exploitation of CVE-2017-7391, a cross-site scripting vulnerability in MAGMI that was used to target vulnerable Magento sites.

Analysis

CVE-2020-5776 is a cross-site request forgery (CSRF) vulnerability in MAGMI for Magento. This flaw exists because the GET and POST endpoints for MAGMI don’t implement CSRF protection, such as random CSRF tokens. An attacker could exploit this vulnerability to perform a CSRF attack by tricking a Magento Administrator into clicking on a link while they are authenticated to MAGMI. The attacker could hijack the administrator’s sessions, allowing them to execute arbitrary code on the server where MAGMI is hosted.

CVE-2020-5777 is an authentication bypass vulnerability in MAGMI for Magento version 0.7.23 and below due to the presence of a fallback mechanism using default credentials.

MAGMI uses HTTP Basic authentication and checks the username and password against the Magento database’s admin_user table. If the connection to the Magento database fails, MAGMI will accept default credentials, which are magmi:magmi. As a consequence, an attacker could force the database connection to fail due to a database denial of service (DB- DoS) attack, then authenticate to MAGMI using the default credentials.

The impact of this attack is remote code execution (RCE) on the server where MAGMI is hosted. During our testing, we successfully performed a Magento DB- DoS attack only when the following condition was true: the maximum number of concurrent MySQL connections was greater than the maximum number of concurrent Apache HTTP connections (or another HTTP or PHP server). By sending a large number of concurrent connection requests that exceed the MySQL connections limit, but not the maximum Apache HTTP connection limit, attackers could temporarily block access to the Magento database and simultaneously make an authenticated request to MAGMI using the default credentials.

The MySQL connections limit can be found in a variable called “max_connections,” which is 151 by default. You can check this value by connecting to the MySQL instance and executing the following database query: SHOW VARIABLES LIKE "max_connections";

The Apache HTTP connections limit is located in a directive called “MaxRequestWorkers” (or MaxClients or pm.max_children) in the Apache Multi-Processing Module (MPM) configuration.

In our testing, we found that at least since Apache version 2.4.10, the default value is either 400 or 250. In prior versions of Apache, the default value was 150, which is smaller than the MySQL default max_connections. For more information about MaxRequestWorkers please check your Apache server documentation.

Proof of concept

A proof of concept (PoC) for these vulnerabilities can be found under the poc folder on Tenable’s GitHub page.

Vendor response

Tenable Research reached out to the developer of the MAGMI plugin on June 3. After follow-up communications on June 17 and July 6, we received acknowledgement on July 6 that the issues we identified were in the process of being fixed. We have since sent requests for updates and have not received any. However, the developers released a new version of the plugin on August 30 to address one of the two vulnerabilities (CVE-2020-5777). A summary of the disclosure process can be found in the Tenable Research Advisory, TRA-2020-51.

Solution

A patch has been published for CVE-2020-5777 in MAGMI version 0.7.24 on August 30. This patch should be applied as soon as possible. At the time this blog post was published, however, there was still no patch available for CVE-2020-5776. To reduce your risk in the meantime, we recommend disabling or uninstalling the plugin altogether until a patch is available, as well as refraining from active web browsing while authenticated to MAGMI.

It should also be noted that there is a fork of MAGMI for Magento 2 that is also vulnerable to these flaws. Because it is a fork of the original MAGMI plugin, users of the Magento 2 plugin should disable or uninstall the plugin until patches are available for the Magento 2 version.

Identifying affected systems

A list of Tenable plugins to identify these vulnerabilities will appear here as they’re released.

Get more information

Join Tenable's Security Response Team on the Tenable Community.

Learn more about Tenable, the first Cyber Exposure platform for holistic management of your modern attack surface.

Get a free 30-day trial of Tenable.io Vulnerability Management.

Subscribe to the Tenable Blog

Subscribe
Try for Free Buy Now

Try Tenable.io

FREE FOR 30 DAYS

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Sign up now.

Buy Tenable.io

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

65 assets

Choose Your Subscription Option:

Buy Now
Try for Free Buy Now

Try Nessus Professional Free

FREE FOR 7 DAYS

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy Nessus Professional

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy a multi-year license and save. Add Advanced Support for access to phone, community and chat support 24 hours a day, 365 days a year. Full details here.

Try for Free Buy Now

Try Tenable.io Web Application Scanning

FREE FOR 30 DAYS

Enjoy full access to our latest web application scanning offering designed for modern applications as part of the Tenable.io platform. Safely scan your entire online portfolio for vulnerabilities with a high degree of accuracy without heavy manual effort or disruption to critical web applications. Sign up now.

Buy Tenable.io Web Application Scanning

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

5 FQDNs

$3,578

Buy Now

Try for Free Contact Sales

Try Tenable.io Container Security

FREE FOR 30 DAYS

Enjoy full access to the only container security offering integrated into a vulnerability management platform. Monitor container images for vulnerabilities, malware and policy violations. Integrate with continuous integration and continuous deployment (CI/CD) systems to support DevOps practices, strengthen security and support enterprise policy compliance.

Buy Tenable.io Container Security

Tenable.io Container Security seamlessly and securely enables DevOps processes by providing visibility into the security of container images – including vulnerabilities, malware and policy violations – through integration with the build process.

Learn More about Industrial Security

Get a Demo of Tenable.sc

Please fill out the form below with your contact information and a sales representative will contact you shortly to schedule a demo. You may also include a short comment (limited to 255 characters). Please note that fields with asterisks (*) are mandatory.

Try for Free Contact Sales

Try Tenable Lumin

FREE FOR 30 DAYS

Visualize and explore your Cyber Exposure, track risk reduction over time and benchmark against your peers with Tenable Lumin.

Buy Tenable Lumin

Contact a Sales Representative to see how Lumin can help you gain insight across your entire organization and manage cyber risk.

Request a demo of Tenable.ot

Get the Operational Technology Security You Need.
Reduce the Risk You Don’t.