OpenMage LTS Media API Flaw Exploited to Plant Web Shell on Store

OpenMage confirmed attackers exploited a media API flaw in OpenMage LTS to drop a web shell on a live store; fixes ship in 20.19.4, 20.18.6 and 21.0.0-beta7.
Table of Contents
    Add a header to begin generating the table of contents

    Attackers exploited a remote code execution flaw in the legacy product media API of OpenMage LTS, a Magento fork, to plant a web shell on a live online store. OpenMage confirmed the in-the-wild exploitation, and fixes are available in three releases.

    Where the OpenMage LTS Product Media API Flaw Sits

    The vulnerability is in the update() method of Mage_Catalog_Model_Product_Attribute_Media_Api. The method builds a file path from the gallery file name without confining it to the media directory, which is a path-traversal weakness classified as CWE-22. It also does not verify that the uploaded bytes are an image, a missing-validation weakness classified as CWE-434.

    The sister create() method in the same API already validated images, so the update() method lacked a check that its counterpart had.

    OpenMage CVSS Scores and the SQL Injection Factor

    The flaw carries a CVSS score of 6.6. The score rises to 7.2 on stores that also have a separate SQL injection vulnerability, a combination that matters here because the reported attack used one.

    How Attackers Chained SQL Injection to the Media Update Call

    Exploitation requires an API role with the Catalog, Product, Media, Update permission, plus a malicious gallery row. According to OpenMage, attackers seeded that gallery row through SQL injection and then sent a JSON-RPC update call.

    The result is an arbitrary file write anywhere the PHP process can write, which is often the web root. A file written there can run as code, and in the reported attack the attackers used it to drop a web shell on a live store.

    Affected and Fixed OpenMage Versions

    The flaw affects OpenMage LTS before 20.19.4, before 20.18.6 and before 21.0.0-beta7. The fixes are in OpenMage LTS 20.19.4, 20.18.6 and 21.0.0-beta7, matching the three release lines.

    Why OpenMage Online Stores Face Code Execution Risk

    An arbitrary file write that reaches the web root leads directly to code execution on the store’s server. For an e-commerce site, a web shell gives the attacker a foothold from which to run commands on the system hosting the shop.

    The reporting comes from a single source, a single outlet citing OpenMage’s own account of the attack. It dates the advisory and exploitation report to December 3 and 4.

    What the OpenMage Reporting Does Not Establish

    The material reviewed does not say how many stores were compromised or who carried out the attacks. It also does not identify the SQL injection flaw used to seed the malicious gallery row, referring to it only as a separate SQL injection. The OpenMage confirmation covers exploitation in the wild against a live store, and the exact scope beyond that remains unreported.

    The chain described has two parts that depend on each other: a way to write the malicious gallery row and an API role with the media update permission. The advisory’s fix targets the media API method itself, adding the path confinement and image verification that the update() method lacked. Patched releases are available now for each of the three supported lines.

    Permissions and Preconditions Behind the OpenMage Exploit

    The need for an API role with the media update permission means the flaw is not a pure unauthenticated remote code execution bug on a default store. An attacker must first obtain that role context, which in the reported attack was achieved by combining the flaw with a separate SQL injection. This is why the CVSS score rises from 6.6 to 7.2 on stores that also carry that second weakness.

    OpenMage’s account covers the technique: seed a gallery row with a malicious path, then call update over JSON-RPC so the media API writes attacker-controlled bytes to the chosen location. The missing image check means the written file need not be an image, and the missing path confinement means it need not stay in the media directory. Both gaps exist in the same method, which is why the fix addresses them together.

    Related Posts