How CosmicSting works
Magento's REST API accepted XML that could point to files on the server. By sending a crafted request, an attacker could get the store to read a file and return its contents. The usual target was app/etc/env.php, which holds the database password and the encryption key.
The encryption key is the valuable part. With it, attackers can mint their own admin API tokens and edit the store through the API, and that is how most CosmicSting victims ended up with a card skimmer on checkout. On servers that also ran a vulnerable glibc (CVE-2024-2961), the same flaw could be pushed further, to running code.
Adobe fixed it in bulletin APSB24-40 in June 2024. Within weeks it was being exploited at scale: Sansec counted more than 4,000 stores hacked through it by seven different groups. CISA added it to its list of known exploited vulnerabilities in July 2024.
What attackers do with it
- A copy of env.php, with your database credentials and encryption key.
- Admin API access, used to plant skimmers in CMS blocks, store configuration or layout updates.
- Code execution on servers that also run a vulnerable glibc.
