Unknown threat actors implanted backdoor code into multiple WordPress themes and plugins after compromising the website of their developer, Automattic’s Jatpack security research team reports.
The impacted vendor, AccessPress Themes, distributes its extensions both on its own website and on WordPress’ official web store, and claims to have over half a million users.
According to Jetpack, a third party managed to compromise AccessPress Themes’ website and inject backdoor code into all of the vendor’s themes and plugins, in an attempt to compromise the websites that use them.
The extensions did not contain the malicious code when downloaded from WordPress.com, and Jetpack discovered that the vendor’s website was compromised in early September.
The vendor has since removed the compromised extensions from its website, but some of them remain unavailable in the WordPress.org theme repository until known clean versions are submitted.
All of the impacted themes and plugins were injected with a dropper that installs a cookie-based webshell, Jetpack says. Once installed, the code provides the attackers with full access to the injected WordPress sites.
The dropper was injected in the inital.php file, which is located in an extension’s main directory and the main plugin file was modified to ensure inital.php is executed. The webshell is installed as a function in a manner that would avoid raising suspicion.
After installing the shell, the dropper sends to the command and control (C&C) server information about the infected website and the themes it uses. Next, the dropper source file is removed, to evade detection.
Looking at the timestamps for the backdoored extensions, Jetpack discovered that the attackers injected code in most of AccessPress Themes’ plugins on September 6 and 7, and that the themes were modified on September 22.
“This suggests to us that the files from the AccessPress Themes’ website were modified intentionally, and as a coordinated action after they were originally released. The compromise seems to have been performed in two stages, one for the plugins and a later one for the themes,” Jatpack says.
The researchers point out that they only analyzed the free extensions on AccessPress Themes’ website, but not the paid pro extensions, though they believe those have been compromised as well.
Roughly 40 of the compromised themes and several plugins have yet to be updated to a clean version.
Users are advised to migrate to clean themes and plugins at least until the issue is fully addressed. They also need to reinstall WordPress to eliminate the malicious code, as the backdoor would remain installed even after switching to another extension.