Threat actors planted a backdoor into multiple WordPress themes and plugins after compromising the website of their developer.
In a classic supply chain attack, threat actors planted a backdoor in dozens of WordPress plugins and themes hosted on a developer’s website. The attack took place in the first half of September 2021, the attackers compromised 40 themes and 53 plugins belonging to AccessPress Themes. The issue has been tracked as CVE-2021-24867.
The security researchers from JetPack discovered the attack while investigating a compromised site using a theme by AccessPress Themes. On further investigation, the experts discovered that all the themes and most plugins from the company available on their own website were backdoored. The same components available on the WordPress.org directory appeared clean.
“The infected extensions contained a dropper for a webshell that gives the attackers full access to the infected sites. The dropper is located in the file inital.php located in the main plugin or theme directory. When run it installs a cookie based webshell in wp-includes/vars.php. The shell is installed as a function just in front of the wp_is_mobile() function with the name of wp_is_mobile_fix(). This is presumably to not arouse suspicion to anybody casually scrolling through the vars.php file.” reads the advisory published by JetPack.
The researchers also spotted another variant of the backdoor directly embedded in the theme/plugin’s functions.php file. This variant is likely an older version of the malware an uses the same mechanism with piecing together the payload from eight cookies.
Below is the list of themes and versions compromised by the attack. AccessPress Themes has yet to provide updates for any of these components and they have been removed from the WordPress.org repository.
Researchers from security firm Sucuri published a separate analysis the revealed that some of the infected websites had spam payloads dating back almost three years. This circumstance suggests that threat actors behind the campaign were likely selling access to the websites to other cyber cybercrime groups.
“we found quite a few compromised sites that lined up with the same timeline for this hack. Some of the infected websites we found utilising this backdoor had old recycled spam payloads that we have seen on other websites as far back as three years.” states Sucuri. “If I had to guess, whoever was behind the initial compromise of AccessPress were likely selling access to backdoored websites on the black market to spammers who recycled the same old malware that they always use on websites.”
In order to check if a website has been affected by this attack, administrators can perform the following actions recommended by Sucuri experts:
- Check your wp-includes/vars.php file around lines 146-158. If you see a “wp_is_mobile_fix” function there with some obfuscated code, you’ve been compromised
- You can also query your file system for “wp_is_mobile_fix” or “wp-theme-connect” to see if there are any affected files
Follow me on Twitter: @securityaffairs and Facebook
(SecurityAffairs – hacking, WordPress themes)
The post Tens of AccessPress WordPress themes compromised as part of a supply chain attack appeared first on Security Affairs.
Source: Security Affair