Skip to content
Threat Feed
high advisory

CVE-2021-47937: e107 CMS Authenticated Remote Code Execution via Theme Upload

e107 CMS 2.3.0 contains a remote code execution vulnerability (CVE-2021-47937) that allows authenticated users with theme installation permissions to execute arbitrary commands by uploading malicious theme files, leading to arbitrary code execution on the server.

e107 CMS version 2.3.0 is vulnerable to remote code execution (CVE-2021-47937). This vulnerability allows authenticated users who possess theme installation permissions to execute arbitrary commands on the server. The attack involves uploading a specially crafted theme file through the theme.php endpoint. The uploaded theme package includes a web shell that is deployed to the e107_themes directory. Once deployed, attackers can execute arbitrary system commands by accessing the payload.php script, effectively gaining control of the server. This vulnerability poses a significant risk to e107 CMS deployments, as it enables unauthorized code execution and potentially full system compromise.

Attack Chain

  1. An attacker authenticates to the e107 CMS application with an account that has theme installation permissions.
  2. The attacker crafts a malicious theme package containing a PHP web shell (e.g., payload.php).
  3. The attacker uploads the malicious theme package via the theme.php endpoint.
  4. The e107 CMS installs the uploaded theme, placing the web shell (e.g., payload.php) within the e107_themes directory.
  5. The attacker sends an HTTP request to the deployed web shell (e107_themes/payload.php).
  6. The web shell executes arbitrary system commands specified in the HTTP request parameters (e.g., payload.php?cmd=whoami).
  7. The server executes the command, and the web shell returns the output to the attacker.
  8. The attacker uses the web shell to perform further actions such as escalating privileges, installing malware, or exfiltrating data.

Impact

Successful exploitation of CVE-2021-47937 leads to remote code execution, allowing attackers to gain complete control over the e107 CMS server. An attacker could potentially deface websites, steal sensitive data, install malware, or use the compromised server as a foothold for further attacks within the network. The CVSS v3.1 score of 8.8 highlights the high severity of this vulnerability.

Recommendation

  • Apply any available patches or upgrades provided by e107 to address CVE-2021-47937.
  • Restrict theme installation permissions to only highly trusted administrators to limit the attack surface.
  • Deploy the Sigma rule Detect Suspicious e107 Theme Upload - CVE-2021-47937 to identify attempts to upload malicious theme files.
  • Monitor web server logs for access to unusual PHP files within the e107_themes directory to detect web shell activity (e.g., payload.php).
  • Implement strict file upload validation to prevent the upload of potentially malicious files.

Detection coverage 2

Detect Suspicious e107 Theme Upload - CVE-2021-47937

high

Detects CVE-2021-47937 exploitation — suspicious POST request to theme.php endpoint with potentially malicious file upload

sigma tactics: execution, initial_access techniques: T1059.002, T1190 sources: webserver

Detect e107 Web Shell Activity

medium

Detects potential web shell access within the e107 themes directory

sigma tactics: execution techniques: T1505.003 sources: webserver

Detection queries are available on the platform. Get full rules →