CosmicSting CVE-2024-34102: patching and monitoring Magento 2

2 min read 5 views

CosmicSting is one of the most serious threats to Magento and Adobe Commerce stores in recent years. This article concerns a vulnerability disclosed in 2024; it does not measure the current attack frequency. CosmicSting, designated as CVE-2024-34102, allows attackers to access key files, including encrypted data and cryptographic keys.

Threat and Impact

Hackers gain access to the cryptographic key in the app/etc/env.php file, which allows them to modify CMS blocks via the Magento API and inject malicious JavaScript to steal customer data. In addition, by using another vulnerability (CVE-2024-2961), they can run code on the server and install a backdoor, enabling long-term access to the system.

Stages of the Attack

The first step of the CosmicSting attack is to obtain the encryption key, which is done by sending properly crafted requests to the Magento API. Next, using this key, hackers create a JWT token, which may enable abuse of Magento API permissions. Finally, they modify existing CMS blocks by adding malicious scripts to them.

How Can You Protect Yourself?

1. System Update - Updating Adobe Commerce to the latest version is crucial to avoid cryptographic key theft.

2. Key rotation – After applying the patches, follow Adobe's current procedure. Rotation adds a new primary key; older keys may still be needed to decrypt existing data. Do not remove them without checking dependencies and the data migration procedure.

Temporary Workarounds

Check the current Adobe bulletin for affected versions, patches and incident response guidance. Blocking one API endpoint or filtering script tags does not replace patching the vulnerability and investigating a compromised store.

It is also worth implementing monitoring tools that detect unauthorized JavaScript, increasing the security of your Magento store. It is also possible to run a Magento module that cleans script code before CMS blocks are saved and before they are displayed on the page.

Summary:

CosmicSting poses a serious threat that can have disastrous consequences for unprotected stores. All Magento and Adobe Commerce users should take immediate steps to update their system and protect their customers' data.

Sources and monitoring scope

Reviewed on October 9, 2026. Consult Adobe security bulletin APSB24-40 and Adobe’s store security and key rotation guidance. Kowal Security Scan helps monitor threat signals; it does not replace security patches or incident remediation.

Keep reading

StyleSmuggler and recent attacks on Magento stores: how hackers operate and how to reduce risk

StyleSmuggler and recent attacks on Magento stores: how hackers operate and how to reduce risk

9 min read 20 views
A practical overview of the StyleSmuggler attack on Magento and Adobe Commerce: how the 0-day works, where to look for signs of compromise, and how to temporarily reduce risk.
Read more
Update cookie preferences