GHSA-gp6m-fq6h-cjcx Magento LTS vulnerable to stored XSS in admin file form

Not scored Published

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

  1. Create empty file with this filename: <img src=x onerror=alert(1)>.crt
  2. Go to System > Configuration > Sales | Payment Methonds.
  3. Click Configure on PayPal Express Checkout.
  4. Choose API Certificate from dropdown API Authentication Methods.
  5. Choose the XSS-file and click Save Config.
  6. Profit, alerts "1" -> XSS.
  7. 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.

PackageAffectedFixed in
openmage/magento-lts PackagistAll versions19.5.3
openmage/magento-lts PackagistAll versions19.5.3
openmage/magento-lts PackagistFrom 20.0.020.5.0
openmage/magento-lts PackagistFrom 20.0.020.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.

Sources

Is GHSA-gp6m-fq6h-cjcx in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free