# OpenMage LTS (Magento 1 fork) legacy product media API update() path-traversal / arbitrary file write (GHSA-qjwx-wccq-qmj5, no CVE) exploited to deploy web shells

> OpenMage LTS's legacy product media API update() operation joined stored gallery filenames to the media path without rejecting '..' segments and never verified that submitted content was a real image, allowing arbitrary file write and RCE. Maintainers report a real-world chain against a store running OpenMage LTS 20.19.1: SQL injection to seed a traversing gallery row, then a JSON-RPC update call to drop a web shell.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-04T16:57:18Z
- **Last updated:** 2026-12-04T16:57:18Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7526
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7526.png
- **ID:** TL-2026-7526
- **Severity:** HIGH (CVSS 7.2)
- **Category:** VULNERABILITY
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 11
- **CVEs:** CVE-2026-25525

## Description

GHSA-qjwx-wccq-qmj5 (published 2026-12-03 by maintainer colinmollenhour; reporter and fix author: hirale) describes an arbitrary file write in Mage_Catalog_Model_Product_Attribute_Media_Api::update() in OpenMage LTS, the community-maintained Magento 1 fork (not Magento 2 / Adobe Commerce). The method joined the gallery file name to the media base path without rejecting '..' segments, so writes could leave the product media directory. It checked the declared MIME type against a static list but never inspected the actual bytes and, unlike create(), did not re-encode images, so script content was stored as-is. An earlier path-traversal fix (commit b89f0bf) had changed only create(). The advisory is classified CWE-22 and CWE-434 and has no CVE assigned (the 20.19.4 release notes say a CVE has been requested).

Exploitation requires an API role with Catalog > Product > Media > Update, reachable via SOAP, SOAP v2, XML-RPC or JSON-RPC, plus a gallery row whose stored value already contains a traversing path. Normal save paths reject such values as of 20.19.3, so the row must come from a separate write primitive such as SQL injection, a compromised database account or a malicious module. The advisory reports an in-the-wild chain against a store on 20.19.1: SQL injection seeded the gallery row, then a JSON-RPC update call wrote a web shell. Remote code execution follows if the web server executes the written file. Even without traversal, an account with the media update permission can overwrite existing product images with arbitrary bytes.

Base CVSS is 6.6 (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H, Moderate); the advisory says stores where a traversing gallery row can be written through another flaw should be rated High 7.2 (AC:L), the score used here. The fix replaces the write with _replaceImageFile(), which requires the filename to pass isValidFile(), stay inside the product media directory and carry an image extension; content goes to a temp file, is validated and re-encoded by core/file_validator_image, then moved into place. Rejected updates return not_created with the message 'Detected malicious path or filename input.' Patching blocks the entry point but does not remove an existing backdoor. No threat actor, web shell filename, hash or network infrastructure has been published; the number of affected merchants beyond the one reported store is unknown.

## MITRE ATT&CK

- T1190 Exploit Public-Facing Application
- T1505.003 Server Software Component: Web Shell
- T1059 Command and Scripting Interpreter
- T1036.008 Masquerading: Masquerade File Type
- T1565.001 Data Manipulation: Stored Data Manipulation
- T1078 Valid Accounts

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**OpenMage LTS Legacy API Call Followed by PHP Web Shell Request in media/ (GHSA-qjwx-wccq-qmj5)** (`TL-2026-7526-SPL-001`)

Behaviour-first exploitation chain detection for TL-2026-7526. Correlates, per source IP over 24h, a POST to an OpenMage LTS / Magento 1 legacy API endpoint (/api.php, /api/soap, /api/v2_soap, /api/xmlrpc, /api/jsonrpc, where catalog_product_attribute_media.update is delivered) with a successful request to an executable script (.php/.phtml/.phar) under media/. This matches the reported chain: a JSON-RPC update() call writes a web shell through a traversing gallery row, then the attacker requests the dropped file. The Sigma flavour covers the web shell request leg only because Sigma cannot join the two legs.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1190, T1505.003
- **Data sources:** apache_access (index=web, sourcetype=access_combined), nginx_access, CommonSecurityLog (WAF/CEF)
- **Severity:** high
- **Confidence:** high

### Splunk SPL

```spl
index=web sourcetype=access_combined earliest=-24h | eval api_post=if(method="POST" AND match(uri_path, "(?i)/(index[.]php/)?api([.]php|/(soap|v2_soap|xmlrpc|jsonrpc))$"), 1, 0) | eval shell_hit=if(match(uri_path, "(?i)/media/.+[.](php[0-9]?|phtml|phar)$") AND tonumber(status)<400, 1, 0) | eval api_time=if(api_post=1, _time, null()) | stats sum(api_post) AS api_posts sum(shell_hit) AS media_php_hits min(api_time) AS first_api_call values(uri_path) AS paths BY clientip | where api_posts>0 AND media_php_hits>0
```

### Microsoft KQL

```kql
CommonSecurityLog
| where TimeGenerated > ago(24h)
| extend Url = tolower(RequestURL)
| extend ApiPost = (RequestMethod =~ 'POST' and Url matches regex '/(index[.]php/)?api([.]php|/(soap|v2_soap|xmlrpc|jsonrpc))'), MediaPhp = (Url matches regex '/media/.+[.](php[0-9]?|phtml|phar)([?]|$)')
| summarize ApiPosts = countif(ApiPost), MediaPhpHits = countif(MediaPhp), FirstApiCall = minif(TimeGenerated, ApiPost), Urls = make_set(RequestURL, 10) by SourceIP
| where ApiPosts > 0 and MediaPhpHits > 0
| project SourceIP, ApiPosts, MediaPhpHits, FirstApiCall, Urls
```

### Sigma

```yaml
title: OpenMage LTS Web Shell Requested Under media Directory
id: 7c1e4a52-3b8d-4f6a-9d21-5e0a8b3c7f14
status: experimental
description: Detects successful requests to executable script files (php, phtml, phar) under the media directory of an OpenMage LTS / Magento 1 store, the web shell drop location for GHSA-qjwx-wccq-qmj5 (TL-2026-7526).
references:
  - https://github.com/OpenMage/magento-lts/security/advisories/GHSA-qjwx-wccq-qmj5
author: Threadlinqs Team
date: 2026/12/04
tags:
  - attack.initial_access
  - attack.t1190
  - attack.persistence
  - attack.t1505.003
logsource:
  category: webserver
detection:
  selection_dir:
    cs-uri-stem|contains: '/media/'
  selection_ext:
    cs-uri-stem|endswith:
      - '.php'
      - '.phtml'
      - '.phar'
  selection_status:
    sc-status: 200
  condition: selection_dir and selection_ext and selection_status
falsepositives:
  - Custom modules that intentionally serve PHP from media/
level: high
```

**Known false positives:**

- Administrators or integrations legitimately calling the legacy API from the same IP that also fetches a PHP file under media/ (rare; PHP is normally not served from media/)
- Shared egress/NAT IPs where an unrelated visitor requests a media PHP path during the same 24h window as a legitimate API call

**Tuning notes:** Adjust index/sourcetype to your web log source (nginx: sourcetype=nginx:plus:access or access_combined). Reduce the window to 1h for faster alerting. Add known partner API source IPs to an exclusion list. If your store serves PHP from other writable directories, extend the shell_hit regex beyond /media/. Patched stores will not be exploitable but existing backdoors still match.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- OpenMage Legacy API Access from Non-Allowlisted Source (locked: unlock with TL Creds)
- Web Server Process Spawning Shell or Recon Utilities (OpenMage Web Shell Execution) (locked: unlock with TL Creds)
- Web Server Process Outbound Connection to Public IP on Non-Web Port (locked: unlock with TL Creds)
- Path Traversal Sequence in Requests to OpenMage API or media Paths (locked: unlock with TL Creds)
- Traversing Value Written to [indicator] (locked: unlock with TL Creds)
- Reverse Shell or Download-and-Execute Command Spawned by PHP/Web Server Process (locked: unlock with TL Creds)
- Executable Script File Created Under OpenMage media/ Directory (locked: unlock with TL Creds)
- Web Shell Interaction: Repeated or Command-Parameter Requests to PHP Files in media/ (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sources

- [GHSA-qjwx-wccq-qmj5: Legacy product media API update() arbitrary file write (RCE)](https://github.com/OpenMage/magento-lts/security/advisories/GHSA-qjwx-wccq-qmj5)
- [OpenMage LTS v20.19.4 release notes](https://github.com/OpenMage/magento-lts/releases/tag/v20.19.4)
- [OpenMage Magento Zero-Day Vulnerability Actively Exploited to Deploy Web Shells on Online Stores (GBHackers)](https://gbhackers.com/openmage-magento-zero-day-vulnerability/)
- [Fix commit 34fcd34177 (20.19.4 / main)](https://github.com/OpenMage/magento-lts/commit/34fcd34177)
- [Fix commit ee79217495 (20.18.6)](https://github.com/OpenMage/magento-lts/commit/ee79217495)
- [Related advisory GHSA-c6j2-fqrr-hvqp: product image APIs copying server images into public media directory](https://github.com/OpenMage/magento-lts/security/advisories/GHSA-c6j2-fqrr-hvqp)
- [Related advisory GHSA-f33f-mg8g-75p9: SQL injection via sales list API filter keys (fixed in same release)](https://github.com/OpenMage/magento-lts/security/advisories/GHSA-f33f-mg8g-75p9)
- [Earlier related OpenMage LTS path traversal CVE-2026-25525 (GHSA-6vqf-6fhm-7rc6)](https://osv.dev/vulnerability/CVE-2026-25525)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7526
