/

CVE-2026-71232

Severity:

HIGH RISK

(7.2)

PHP Code Injection (CWE-94) in MacCMS10 Templates Editor

CVE-2026-71232

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.2)

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

MacCMS10's administrative template editor uses an incomplete blacklist to restrict PHP functions while processing template content. An authenticated administrator who can edit templates may abuse ThinkPHP template syntax to inject PHP code and execute commands on the server.

Affected context

The vulnerability occurs in MacCMS10 deployments where an authenticated administrator has access to the template editor and submitted template content is processed by the affected filtering and rendering logic. Risk is higher when administrative access is broadly assigned or when the application process has write, database, or operating-system privileges beyond those required for normal operation.

Exploit preconditions

  • Attack surface: Administrative template-editing functionality
  • Required access: Authenticated administrator privileges or equivalent permission to modify templates
  • Trigger point: Saving or rendering template content that is interpreted by the ThinkPHP template engine
  • Why exploitation is possible: The blacklist does not cover several executable PHP functions, while the {if} template tag can place its condition directly into generated PHP code

Why this happens

The underlying flaw is reliance on a denylist regular expression to identify dangerous PHP functions in content that is later compiled into executable PHP. Because the denylist omits multiple execution-capable functions and the template engine embeds certain attributes into raw PHP expressions, attacker-controlled template text can cross from data into executable code. This behavior maps to CWE-94: Improper Control of Generation of Code, where input influences code generation without a sufficiently restrictive and context-aware validation model.

Potential impact

  • An attacker may execute operating-system commands under the application's service account.
  • The application may be compromised or modified.
  • Sensitive files, credentials, or environment data could be exposed.
  • Attackers could alter website content, inject persistent malicious behavior, or damage stored data.
  • The host or connected services could be affected if the application has excessive privileges.

General mitigation guidance

Mitigation generally focuses on preventing administrator-controlled template text from becoming executable PHP.

Common defensive patterns include:

  • Replace blacklist filtering with a safe template model that permits data substitution and predefined presentation constructs without arbitrary PHP evaluation.
  • Treat template expressions as untrusted input and enforce an allowlist of supported syntax and operations.
  • Compile templates in a restricted environment and prevent access to operating-system and dynamic-code execution functions.
  • Separate template editing from deployment of executable application code, using controlled review and publication workflows.
  • Apply least privilege to the web process, including restricted filesystem, database, and operating-system permissions.
  • Limit template-editor access to trusted roles and require strong authentication and audit logging.

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying blacklist-based filtering around PHP code generation or template compilation.
  • Code review checks for template tags whose attributes are inserted into raw PHP without an allowlist or safe intermediate representation.
  • Searches for dynamic evaluation functions, command-execution APIs, and parser configurations that permit executable code.
  • Runtime monitoring for unexpected template changes, generated PHP files, child processes, or command execution by the web service account.
  • Policy enforcement requiring security review for editable templates and prohibiting arbitrary code execution in content-management features.
  • Automated code review tools may help identify dangerous parser and code-generation patterns, but findings should be validated against the actual template engine behavior.

Sources

SourceLink
github.comgithub.com/magicblack/maccms10/commit/71ad3bb29570e110d8e973acff68040a3050ddf0

Frequently asked

questions

Exploitation generally requires an authenticated account with permission to edit or otherwise control administrative templates. The practical scope therefore depends on role assignments and administrative access controls.

Not necessarily. An attacker may use the application's administrative interface if they possess the required credentials and the interface is reachable through an authorized session.

The safest pattern is to prevent editable template content from generating arbitrary PHP, using a restricted, allowlisted template language and a rendering process that does not expose operating-system or dynamic-code execution functions.

Review template engines as code-generation components, avoid denylist-only defenses, restrict template-editor privileges, monitor template changes, and run the application with minimal operating-system permissions.

Find out what's already
exploitable in your codebase.