GHSA-gp6m-fq6h-cjcx Magento LTS vulnerable to stored XSS in admin file form
Low-privileged attackers can inject malicious scripts via file uploads in Magento admin, leading to XSS execution in victim browsers.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is GHSA-gp6m-fq6h-cjcx?
GHSA-gp6m-fq6h-cjcx is a cross-site scripting vulnerability in openmage/magento-lts, published on 27 Feb 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
Summary
OpenMage is affected by a stored Cross-Site Scripting (XSS) vulnerability that could be abused by a low-privileged attacker to inject malicious scripts into vulnerable form fields.
Details
Mage_Adminhtml_Block_System_Config_Form_Field_File does not escape filename value in certain situations.
Same as: https://nvd.nist.gov/vuln/detail/CVE-2024-20717
PoC
- Create empty file with this filename:
<img src=x onerror=alert(1)>.crt - Go to System > Configuration > Sales | Payment Methonds.
- Click Configure on PayPal Express Checkout.
- Choose API Certificate from dropdown API Authentication Methods.
- Choose the XSS-file and click Save Config.
- Profit, alerts "1" -> XSS.
- Reload, alerts "1" -> Stored XSS.
Impact
Affects admins that have access to any fileupload field in admin in core or custom implementations. Malicious JavaScript may be executed in a victim’s browser when they browse to the page containing the vulnerable field.
Which versions are affected by GHSA-gp6m-fq6h-cjcx?
4 open source packages ship an affected version, including openmage/magento-lts.
| Package | Affected | Fixed in |
|---|---|---|
openmage/magento-lts Packagist | All versions | 19.5.3 |
openmage/magento-lts Packagist | All versions | 19.5.3 |
openmage/magento-lts Packagist | From 20.0.0 | 20.5.0 |
openmage/magento-lts Packagist | From 20.0.0 | 20.5.0 |
How do I fix GHSA-gp6m-fq6h-cjcx?
Upgrade openmage/magento-lts to a fixed version for your release line: 19.5.3 or 20.5.0.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is GHSA-gp6m-fq6h-cjcx being exploited?
There is no known exploitation of GHSA-gp6m-fq6h-cjcx in the wild and no public exploit code.