CosmicSting (CVE-2024-34102): the flaw that compromised thousands of Magento stores

An XML external entity flaw in Adobe Commerce and Magento Open Source let attackers steal secret keys and, combined with another bug, run code. Patching alone was not enough.

Publicly disclosed: 11 June 2024

On 11 June 2024 Adobe fixed a critical vulnerability in Adobe Commerce and Magento Open Source, later nicknamed CosmicSting. Without logging in, an attacker could read files from the server, including the store's secret encryption key, and use it to create admin access tokens. Combined with a separate glibc flaw (CVE-2024-2961), it also allowed code execution. Thousands of stores were compromised and had card-skimming code added to checkout pages.

CVESeverityAffectedFixed in
CVE-2024-34102Critical, CVSS 9.8 (XML external entity)Adobe Commerce / Magento Open Source 2.4.7 and earlier2.4.7-p1, 2.4.6-p6, 2.4.5-p8, 2.4.4-p9 and later

Why patching was not enough

A stolen encryption key stays valid after the update. Adobe advised merchants who could have been affected to rotate the encryption key in addition to patching.

How to protect any CMS

  1. Subscribe to the security announcements of your CMS and apply critical updates within days.
  2. Keep modules, extensions and themes to the minimum you actually use.
  3. Use a WAF in front of the site and do not expose the admin area to the whole internet.
  4. Keep off-site backups and monitor files for unexpected changes.
  5. Replace versions that no longer receive security updates.

For online stores, also monitor checkout pages for unexpected JavaScript and use a payment provider's hosted payment page where possible.

Sources: Adobe bulletin APSB24-40, NVD CVE-2024-34102.

Need help with this? Contact CySec for a free consultation.


All articles

Need help with this?

Our engineers can review your current setup and propose concrete improvements.