This one’s not new — it dates back to June 2024 — but if a Magento store of yours skipped that summer’s patches, it’s still wide open.
At a glance
- CVE: CVE-2024-34102 — better known as “CosmicSting”. Adobe’s bulletin is APSB24-40.
- Severity: 9.8 (Critical). No login and no admin rights needed.
- Affected: Adobe Commerce and Magento Open Source 2.4.7 and earlier, 2.4.6-p5 and earlier, 2.4.5-p7 and earlier, and 2.4.4-p8 and earlier. Adobe Commerce Extended Support customers on 2.4.3-ext-7 / 2.4.2-ext-7 and earlier are affected too.
- Known exploited: Yes — Adobe confirmed attacks against Commerce merchants, and CISA added it to its KEV list on 2024-07-17.
What’s going on
CosmicSting is an XXE bug. XXE (“XML External Entity”) means the app parses XML that can point at other files, and Magento would happily fetch them. An attacker sends a crafted request to the store’s REST API and gets back the contents of files on your server — no account needed. Sansec, who tracked the attacks closely, says the usual first target is app/etc/env.php, because that’s where your secret crypt key lives.
With that key in hand, attackers mint their own API tokens, rewrite your CMS blocks and drop card skimmers into the storefront. Chained with a separate bug (CVE-2024-2961, nicknamed CNEXT), they can also run code on the server and leave backdoors. Sansec watched thousands of stores get hit in automated waves through late 2024. The important bit: patching stops new file reads, but a key that was stolen before you patched still works until you replace it.
Timeline
- Patch released: 2024-06-11 (APSB24-40)
- Published to NVD: 2024-06-13
- First attacks seen: 2024-06-23, per Sansec
- Isolated patch: 2024-06-27 (ACSD-60241)
- Added to CISA KEV: 2024-07-17
- Key-invalidation hotfix: 2024-08-21 (AC-12485), per Sansec
== UPDATE ==
Patches have been out for a long time — the work now is making sure you’re on one and that your old key is dead.
- Patch available: Yep.
- Fixed in: Adobe Commerce and Magento Open Source 2.4.7-p1, 2.4.6-p6, 2.4.5-p8 and 2.4.4-p9 (Extended Support: 2.4.3-ext-8 and 2.4.2-ext-8). Any later patch release on your line includes the fix too. If you can’t move versions, Adobe’s isolated patch ACSD-60241 covers 2.4.4 through 2.4.7.
- How to apply: Upgrade to the latest patch release on your line the way you normally do (on a Composer install, bump the Magento packages and run
bin/magento setup:upgrade), or apply the isolated patch. Then rotate your crypt key and invalidate the old one — Sansec points to Adobe’s AC-12485 hotfix for that. Rotating alone isn’t enough, though: also reset admin passwords and delete any API integrations you don’t recognise, since existing tokens survive a key change. - If you can’t patch yet: Sansec’s stop-gap is to block requests to the CMS block API (
/rest/.../cmsBlock) so a stolen key can’t be used to rewrite your blocks. They’re clear it’s not a fix — attackers can still read files and hit other endpoints — so treat it as buying a few hours, not days.
References
- https://helpx.adobe.com/security/products/magento/apsb24-40.html
- https://sansec.io/research/cosmicsting
- https://www.vicarius.io/vsociety/posts/cosmicsting-critical-unauthenticated-xxe-vulnerability-in-adobe-commerce-and-magento-cve-2024-34102
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2024-34102
- https://nvd.nist.gov/vuln/detail/CVE-2024-34102