Adobe Magento "SessionReaper" Unauthenticated File Upload / LFI (CVE-2025-54236)
by Dx3iZ · 2026-07-06
- Severity
- Critical
- CVE
- CVE-2025-54236
- Category
- web
- Affected product
- Adobe Commerce / Magento Open Source — customer/address_file/upload endpoint (dubbed "SessionReaper")
- Affected versions
- Magento 2.4.9-alpha2, 2.4.8-p2, 2.4.7-p7, 2.4.6-p12, 2.4.5-p14, 2.4.4-p15, and earlier vulnerable releases (per repository README)
- Disclosed
- 2026-07-06
- Patch status
- patched
Tags
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-06 |
| Last Updated | 2026-07-06 |
| Author / Researcher | Dx3iZ |
| CVE / Advisory | CVE-2025-54236 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.1 (per NVD) |
| Status | PoC |
| Tags | magento, adobe-commerce, sessionreaper, file-upload, lfi, customer-address, form-key, cwe-434, python |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Adobe Commerce / Magento Open Source — customer/address_file/upload endpoint (dubbed “SessionReaper”) |
| Versions Affected | Magento 2.4.9-alpha2, 2.4.8-p2, 2.4.7-p7, 2.4.6-p12, 2.4.5-p14, 2.4.4-p15, and earlier vulnerable releases (per repository README) |
| Language / Platform | Python 3.x (requests, urllib3) targeting a PHP/Magento e-commerce application |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
Magento’s customer address form exposes a file-upload field (custom_attributes[country_id]) at customer/address_file/upload that is intended to accept a small file attachment (e.g. a document tied to a custom address attribute), guarded only by a per-request form_key value that the client itself generates and submits — no authenticated session is actually required to reach the endpoint. The PoC script generates a random form_key, uploads an arbitrary local file to this endpoint using multipart form data, and the server responds with the storage path of the uploaded file under Magento’s public media/customer_address/ directory. Because uploaded files are not adequately validated (there is no server-side extension/type allowlist tied to the request source) and land in a web-accessible media directory, an attacker can plant a file (e.g. a PHP web shell or other malicious payload) and directly retrieve/execute it from its published URL, achieving unauthenticated file upload that can escalate to remote code execution or information disclosure depending on the uploaded content and server configuration.
Vulnerability Details
Root Cause
The customer/address_file/upload controller processes file uploads tied to the custom_attributes[country_id] form field without requiring a valid customer session — the only “protection” is a form_key cookie/parameter pair that the client generates itself and that Magento does not tie to a real authenticated session at this endpoint (CWE-434: Unrestricted Upload of File with Dangerous Type, combined with a broken access-control/session-validation assumption — hence the “SessionReaper” nickname). From ankamagento.py:
| |
Because the attacker both mints the form_key and supplies it as the only “authentication” artifact, and the server accepts the file without a genuine logged-in session or file-type restriction, arbitrary content can be uploaded to a predictable, publicly-reachable media path.
Attack Vector
- Generate a random
form_keyvalue locally (no login required). - POST a multipart request to
<target>/customer/address_file/uploadwith the target file under thecustom_attributes[country_id]field, the generatedform_keyas both a form field and cookie. - On a HTTP 200 JSON response, extract the
filepath returned by the server and construct the public URL<target>/media/customer_address/<file>. - GET the resulting URL to confirm the file was stored and is publicly retrievable (the script records confirmed uploads to
success.txtand unconfirmed ones tofalsepositive.txt). - If the uploaded content is executable server-side (e.g. a
.phpweb shell, subject to server/Magento upload filtering in a given deployment), request it directly to achieve code execution; otherwise the technique still yields unauthenticated arbitrary file disclosure/planting on the media host.
Impact
Unauthenticated file upload to a publicly-accessible Magento media directory, which can lead to website defacement, information disclosure, or — where executable file types are not blocked — remote code execution via a planted web shell.
Environment / Lab Setup
Target: Adobe Commerce / Magento Open Source instance running a vulnerable
version (see Versions Affected), with customer/address_file/upload reachable
Attacker: Python 3.x
pip install requests urllib3
Proof of Concept
PoC Script
See
ankamagento.pyin this folder.
| |
The script uploads payload.txt (or the second CLI argument, defaulting to dxeiz.txt) to TARGET/customer/address_file/upload, then attempts to verify the file is retrievable at TARGET/media/customer_address/<returned-path>, appending confirmed hits to success.txt and unconfirmed ones to falsepositive.txt.
Detection & Indicators of Compromise
Signs of compromise:
- Unexpected files (especially
.phpor script-like extensions) present undermedia/customer_address/that do not correspond to legitimate customer address attachments POST /customer/address_file/uploadrequests without an accompanying valid customer login session- Repeated upload attempts across a scanned list of target Magento sites from a single source IP
- Outbound requests to a freshly-uploaded file path immediately following the upload POST
Remediation
| Action | Detail |
|---|---|
| Primary fix | Apply Adobe’s official security patch for CVE-2025-54236 (SessionReaper) and update to a fixed Magento/Adobe Commerce release |
| Interim mitigation | Restrict or disable the customer address file-upload feature if not required, enforce strict file-type/extension allowlisting and disable script execution in the media/customer_address/ directory, and require a genuine authenticated session for the upload endpoint |
References
Notes
Mirrored from https://github.com/Dx3iZ/CVE-2025-54236 on 2026-07-06. ankamagento.py is a functional script automating the Magento SessionReaper file-upload/LFI exploit, as confirmed by direct code review.
| |