← Voltar ao feed

OpenMage LTS legacy media API arbitrary file write (GHSA-qjwx-wccq-qmj5) exploited to drop a web shell; patched in 20.19.4, 20.18.6, 21.0.0-beta7

2 fonte(s) · 2 atualização(ões) · publicado 04/12/2026 01:27 · coletado há 1 dia

Matéria consolidada. Reúne 2 matérias que o Tifon tinha publicado separadamente sobre a mesma história. A IA reescreveu o relatório com o que as 2 fontes trouxeram em 04/12/2026 12:01; os links antigos trazem para cá.

Fontes: gbhackers.com ↗ securityonline.info ↗

OpenMage LTS, the community fork of Magento 1, fixed an arbitrary file write flaw in its legacy product media API that attackers had used in the wild to drop a web shell on one store running 20.19.1. The advisory GHSA-qjwx-wccq-qmj5, published December 3, 2026, rates it Moderate (CVSS 3.1 6.6) and no CVE ID has been assigned (securityonline.info, gbhackers.com). The score rises to 7.2 for stores where an attacker can also alter the database (securityonline.info, gbhackers.com). Exploitation needs an API role with Catalog > Product > Media > Update plus a malicious gallery row in the database, which in the observed attack came from a separate SQL injection. Fixes are in 20.19.4, 20.18.6 and 21.0.0-beta7. Both sources describe a single compromised store and say nothing about a wider campaign. The flaw is separate from the Magento 2 StyleSmuggler and SessionReaper issues (gbhackers.com).

Entenda a falha

A vulnerabilidade

Arbitrary file write in the legacy product media API of OpenMage LTS (the community fork of Magento 1), advisory GHSA-qjwx-wccq-qmj5, with no CVE. It is rated Moderate (CVSS 3.1 6.6), or 7.2 where the attacker can also alter the database. The attacker needs an API role with Catalog > Product > Media > Update plus a malicious gallery row in the database. That row can come from a separate SQL injection, a compromised DB account or a malicious module. The result is a file with arbitrary content written wherever PHP can write, and RCE if the web server executes it. Affected: 20.18.5 and earlier, 20.19.0-20.19.3, 21.0.0-beta1 to beta6. Fixed in 20.19.4, 20.18.6 and 21.0.0-beta7.

Como funciona

A caller with the media-update role sends an update request for an existing product gallery image through the legacy API (SOAP, XML-RPC or JSON-RPC). The update() code takes the file name stored in the gallery record and builds the destination path from it. It does not keep that path inside the product media directory and does not check that the submitted bytes are an image. If the stored name was tampered with beforehand, the content is written outside the media folder, for example in the document root. If the web server runs PHP there, the file becomes code. Without a tampered row, the role can still overwrite an existing product image with arbitrary bytes.

Por que é vulnerável

update() trusted stored gallery file names without confining the resulting path to the media directory (CWE-22), and it did not verify that the content was an image (CWE-434). The sister create() method already validated images, but update() did not. The fix confines file names to the product media directory, requires an image extension, and validates and re-encodes the image before it replaces the existing file. One outlet says these gaps were left unprotected by earlier media security changes.

Onde está

The update() method of Mage_Catalog_Model_Product_Attribute_Media_Api in OpenMage LTS (github.com/OpenMage/magento-lts); fixed in commits 07165f9 (20.19.4), 22ad8dc (20.18.6) and faf80cb (21.0.0-beta7). No PR number was located.

Como foi descoberta

It came to light through exploitation in the wild: according to the OpenMage advisory, attackers used an SQL injection to seed the gallery row and then a JSON-RPC update call to drop a web shell on one store running 20.19.1. The advisory, published December 3, reports only this incident and no wider campaign. The articles do not say who reported it. gbhackers.com calls it a zero-day, while securityonline.info frames it as a fixed advisory with in-the-wild exploitation. gbhackers.com says it relied on a summary and did not read the advisory page, so its account of the incident is secondary.

PoC existente, privada

O exploit existe, mas quem o tem não o publicou.

No public proof of concept is described. A working exploit was used in the wild to drop a web shell on one store, but no published copy is mentioned, so it is treated as private. Because it has already been used in an attack, patch promptly. Patching does not remove a web shell already installed, so audit the catalog_product_entity_media_gallery table for values containing '..', look for unexpected PHP files, and preserve logs.

Explicação gerada por IA a partir da matéria e dos artigos, em 04/12/2026 12:16.

Detalhes técnicos

  • The update() method in Mage_Catalog_Model_Product_Attribute_Media_Api builds a file path from the stored gallery file name without confining it to the media directory (CWE-22). It also does not verify that the uploaded bytes are an image (CWE-434). The sister create() method already validated images (securityonline.info).
  • A crafted name lets a media-API role write arbitrary content anywhere the PHP process can write, which on most installs includes the document root. The legacy API serves SOAP, XML-RPC and JSON-RPC (securityonline.info).
  • Without a malicious gallery row, a media-update role can still overwrite an existing product image with arbitrary bytes (securityonline.info).
  • The gallery row must come from a separate SQL injection, a compromised DB account or a malicious module (securityonline.info). Remote code execution follows only if the web server executes the written file (gbhackers.com).
  • In the observed attack, an SQL injection seeded the gallery row and a JSON-RPC update call then wrote the web shell (securityonline.info).
  • Affected versions: 20.18.5 and earlier, 20.19.0 to 20.19.3, and 21.0.0-beta1 to beta6 (securityonline.info, gbhackers.com).
  • The advisory title is "Legacy product media API update() writes caller-supplied content to an unchecked path (RCE)". A separate Low-rated advisory, GHSA-c6j2-fqrr-hvqp, covers product image APIs copying server images into the public media directory (github.com/OpenMage/magento-lts, via gbhackers.com).
  • Fixed releases: 20.19.4 (commit 07165f9, marked Latest), 20.18.6 (22ad8dc, a security-only patch) and 21.0.0-beta7 (faf80cb). Each release fixes 16 security issues and the notes say to upgrade as soon as possible (github.com/OpenMage/magento-lts).
  • The fix confines file names to the product media directory and re-encodes uploads as images (securityonline.info). It also requires an image extension and validates and re-encodes the image before it replaces the existing file (gbhackers.com). No PR number for the fix was located by either source.

Remediação

  • Upgrade to 20.19.4, 20.18.6 or 21.0.0-beta7.
  • If you cannot upgrade immediately, block api.php and the legacy API endpoints when unused, or remove Media > Update from API roles that do not need it.
  • Block PHP execution under media/. The shipped Apache .htaccess does this, but nginx needs its own equivalent rule.
  • Audit the catalog_product_entity_media_gallery table for values containing .., and look for unexpected PHP files in the store root and media folders. Review legacy API and web server logs. Preserve logs and suspicious files before cleanup (gbhackers.com).
  • Patch any SQL injection on the store.
  • Patching does not remove a backdoor already on the server (gbhackers.com).

Relatos divergentes

  • Characterization: gbhackers.com calls this a "zero-day", while securityonline.info describes it as a fixed advisory with in-the-wild exploitation and does not use the term. Both agree on one incident, no CVE and CVSS 6.6.
  • Incident details: the JSON-RPC and SQL injection sequence is stated directly by securityonline.info. gbhackers.com says it relies on a search-result summary of the advisory and did not read the advisory page, so treat its version as secondary.

Linha do tempo

  1. gbhackers.com ↗ · pub. 04/12/2026 09:36 · coletado 04/12 11:00

    OpenMage LTS zero-day in legacy product media API exploited to plant a web shell on an online store (no CVE, CVSS 6.6)

    ler a análise desta fonte

    OpenMage maintainers patched a zero-day in the legacy product media API of OpenMage LTS, the community fork of Magento 1. Attackers had used it to drop a web shell on one store running 20.19.1. The advisory, published December 3, rates it Moderate (CVSS 6.6) and lists no CVE. The score rises to 7.2 for stores where an attacker can also change the database. The disclosure covers one compromised store and does not say whether other merchants were targeted. The flaw is separate from the Magento 2 StyleSmuggler and SessionReaper issues.

    Technical Details

    • The product gallery update() operation trusted stored gallery filenames without keeping the resulting path inside the media directory. It also checked only the declared media type, not whether the data was an image (gbhackers.com).
    • Exploitation needs an API role with permission to update product media. It also needs a separate way to change stored gallery data. In the reported incident, maintainers attributed that change to SQL injection. Remote code execution follows only if the web server executes the written file (gbhackers.com).
    • The incident used a JSON-RPC update call after the gallery row was seeded through SQL injection (per a search-result summary of the advisory; the advisory page itself was not read).
    • The advisory is GHSA-qjwx-wccq-qmj5, "Legacy product media API update() writes caller-supplied content to an unchecked path (RCE)", rated Moderate and published December 3, 2026 (github.com/OpenMage/magento-lts). A separate Low-rated advisory, GHSA-c6j2-fqrr-hvqp, covers product image APIs copying server images into the public media directory (github.com/OpenMage/magento-lts).
    • Affected versions are 20.18.5 and earlier, 20.19.0 through 20.19.3, and 21.0.0-beta1 through beta6 (gbhackers.com).

    Fix Details

    The fixed releases are 20.18.6, 20.19.4 and 21.0.0-beta7. The fix restricts writes to the product media directory, requires an image extension, and validates and re-encodes the image before it replaces the existing file (gbhackers.com). The pull request was not located.

    Remediation

    • Upgrade to a fixed release.
    • Review legacy API and web server logs, audit gallery records for unexpected paths, and look for unfamiliar PHP files in web-accessible directories. Preserve logs and suspicious files before cleanup.
    • If an immediate upgrade is not possible, block unused legacy API endpoints or remove media-update permission from API roles that do not need it.
    • Disable PHP execution in the media directory. OpenMage ships an Apache rule for this, and Nginx needs an equivalent rule.
    • Patching does not remove a backdoor that is already on the server.
  2. securityonline.info ↗ · pub. 04/12/2026 01:27 · coletado 04/12 02:00 primeiro registro

    OpenMage LTS legacy media API arbitrary file write exploited in the wild to drop a web shell (GHSA-qjwx-wccq-qmj5)

    ler a análise desta fonte

    OpenMage LTS fixed an arbitrary file write flaw in its legacy product media API. Attackers have used it in the wild to drop a web shell on a store running 20.19.1. The advisory (GHSA-qjwx-wccq-qmj5) rates it Moderate, CVSS 3.1 6.6, because exploitation needs an API role with Catalog > Product > Media > Update and a malicious gallery row in the database. The row has to come from a separate SQL injection, a compromised DB account or a malicious module. The article puts the score at 7.2 on stores that also have an SQL injection. Securityonline reports no CVE ID yet, and the advisory describes a single incident, not a wider campaign. Fixes are in 20.19.4, 20.18.6 and 21.0.0-beta7.

    Technical Details

    • The update() method in Mage_Catalog_Model_Product_Attribute_Media_Api builds a file path from the gallery file name without confining it to the media directory (CWE-22). It also does not check that the uploaded bytes are an image (CWE-434). The sister create() method already validated images.
    • A crafted name lets a media-API role write a file with arbitrary content anywhere the PHP process can write, which on most installs includes the document root. The legacy API serves SOAP, XML-RPC and JSON-RPC requests.
    • Without a malicious gallery row, a media-update role can still overwrite an existing product image with arbitrary bytes.
    • In the observed attack, an SQL injection seeded the gallery row and a JSON-RPC update call then wrote the web shell.
    • Affected versions: 20.18.5 and earlier, 20.19.0 to 20.19.3, and 21.0.0-beta1 to beta6.

    Fix Details

    The fixed releases are 20.19.4 (commit 07165f9, marked Latest), 20.18.6 (22ad8dc, a security-only patch) and 21.0.0-beta7 (faf80cb) (github.com/OpenMage/magento-lts). Each release fixes 16 security issues, and the notes say to upgrade as soon as possible (github.com/OpenMage/magento-lts). The change confines file names to the product media directory and re-encodes uploads as images. The release page did not show a PR number for this fix.

    Remediation

    • Upgrade to 20.19.4, 20.18.6 or 21.0.0-beta7.
    • Block api.php and the legacy API endpoints if they are not used, or remove Media > Update from API roles.
    • Block PHP execution under media/. The shipped Apache .htaccess does this, but nginx needs its own rule.
    • Audit the catalog_product_entity_media_gallery table for values containing .., and look for unexpected PHP files in the store root and media folders.
    • Patch any SQL injection on the store.