/

CVE-2021-47939

Severity:

HIGH RISK

(8.8)

Code Injection in Evolution CMS

CVE-2021-47939

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution by Authenticated Users

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Evolution CMS 3.1.6 contains a code injection flaw that lets authenticated users with module creation permissions inject arbitrary PHP into module parameters.

When these crafted modules are created via POST requests and later executed, the embedded PHP code can run arbitrary system commands on the server.

Affected context

The vulnerability occurs within the Evolution CMS administrative interface, specifically in the module management functionality.

It affects deployments where:

  • Users with module creation or editing rights can submit untrusted data to module parameters.
  • PHP code embedded in module definitions is evaluated or executed server-side.
  • There are no robust input validation or output encoding measures for module configuration fields.

The risk is most pronounced in environments where administrative or power-user accounts are shared, weakly protected, or granted more permissions than necessary.

Exploit preconditions

  • Attack surface: HTTP interface of the Evolution CMS manager, particularly /manager/index.php.
  • Required access: Authenticated CMS account with permissions to create or modify modules.
  • Trigger point: Submission of a crafted POST request containing malicious PHP in the post parameter to define or update a module, followed by execution of that module through the CMS.
  • Why exploitation is possible: Module parameters are treated as trusted PHP content and evaluated without adequate sanitization, allowing user-controlled data to become executable server-side code.

Why this happens

The underlying issue is a classic code injection pattern where user-supplied input is incorporated directly into dynamic code that the server later evaluates.

In Evolution CMS, module parameters appear to be stored and executed as PHP without separating configuration data from executable logic.

This maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), where the application constructs or interprets executable code from values that an attacker can influence, without enforcing strict validation, encoding, or use of non-executable representations for user-provided content.

Potential impact

  • Execution of arbitrary system commands with the web server or PHP process privileges.
  • Reading or modification of sensitive CMS data, configuration files, or database contents.
  • Installation of web shells or backdoors for persistent access.
  • Use of the compromised CMS as a pivot point for further attacks within the hosting environment.
  • Defacement or complete takeover of the website managed by Evolution CMS.

General mitigation guidance

Effective mitigation focuses on separating configuration data from executable code and reducing the trust placed in administrative input:

  • Avoid treating module parameters or configuration fields as raw PHP or executable code; store them as data and interpret them using safe, non-eval mechanisms.
  • Introduce strong server-side validation for module definitions, allowing only whitelisted constructs and disallowing arbitrary PHP or shell-related functions in user-controlled fields.
  • Apply the principle of least privilege for administrative roles, granting module creation or editing rights only to strictly necessary accounts and isolating high-risk capabilities.
  • Use execution sandboxes or templating engines that do not allow direct PHP execution when extensibility is required.
  • Limit the system-level privileges of the web server and PHP runtime so that, even if code is injected, its ability to affect the underlying system is constrained.

How teams detect issues like this

Detection generally revolves around identifying unsafe code handling paths and monitoring for suspicious module behavior:

  • Use static analysis to flag dynamic evaluation patterns (e.g., eval, include with user-influenced paths, or direct execution of stored content from configuration tables) in module management code.
  • During code review, scrutinize any features that embed PHP or script code into database-stored configuration, templates, or modules, and verify that these values cannot be arbitrarily controlled by users.
  • Implement application-level logging and monitoring for unusual module creations or updates, such as modules containing PHP function names commonly used in exploitation (e.g., process execution, file system access).
  • Integrate security-focused CI checks or automated scanning tools to highlight code injection sinks and high-risk dynamic code constructs before deployment.

Sources

SourceLink
evo.imevo.im/
github.comgithub.com/evolution-cms/evolution/releases
exploit-db.comexploit-db.com/exploits/50296
vulncheck.comvulncheck.com/advisories/evolution-cms-authenticated-remote-code-execution-via-module-creation

Frequently asked

questions

Yes, but only by authenticated users with specific permissions. An attacker must be able to log into the Evolution CMS manager and have rights to create or modify modules; from there, they can deliver malicious payloads over standard HTTP(S).

The attacker needs an account with module creation or editing privileges. Compromised admin accounts, overprivileged editor accounts, or shared administrative credentials significantly increase the likelihood of exploitation.

The safest pattern is to eliminate direct execution of user-supplied content: treat module parameters as data only, avoid mechanisms that interpret stored values as PHP, and introduce strict validation with a whitelist of allowed constructs or settings in extensibility points.

Design extensibility features so that user input cannot directly become executable code, enforce least-privilege on administrative capabilities, add code review gates for any functionality that stores or evaluates dynamic scripts, and employ automated analysis to flag the use of risky dynamic execution functions.

Find out what's already
exploitable in your codebase.