/

CVE-2026-27174

Severity:

CRITICAL RISK

(9.8)

Code Injection in MajorDoMo Admin PHP Console

CVE-2026-27174

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Unauthenticated Remote Code Execution

Severity:

CRITICAL RISK

(9.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

MajorDoMo's admin PHP console exposes an unauthenticated code execution path where user-supplied GET parameters are passed directly to eval().

Due to an include-order flaw and missing exit after a redirect, unauthenticated requests can reach the console's AJAX handler and execute arbitrary PHP code via crafted admin.php requests.

Affected context

This vulnerability arises in MajorDoMo deployments where the admin panel is exposed over HTTP(S) and reachable by attackers.

The issue is tied to the admin.php entry point, modules/panel.class.php, and the inc_panel_ajax.php console handler, which together create an execution path that bypasses normal authentication checks.

It specifically affects environments where:

  • The admin interface is accessible from untrusted networks, and
  • PHP is configured to execute code via eval(), and
  • Legacy patterns such as register_globals or equivalent variable extraction are in effect.

Exploit preconditions

  • Attack surface: HTTP(S) interface on /admin.php.
  • Required access: Network access to the MajorDoMo admin endpoint (no valid credentials required under default vulnerable flow).
  • Trigger point: A crafted GET request containing ajax_panel, op, and command parameters that reaches the AJAX console handler in inc_panel_ajax.php.
  • Why exploitation is possible:
  • An include order bug in modules/panel.class.php allows execution to continue past a redirect() call that lacks an exit/die, so unauthenticated requests still reach AJAX logic.
  • The console handler takes user-controlled input (via GET and register_globals-style promotion) and passes it directly into PHP eval() without sanitization, validation, or authentication.

Why this happens

The core bug is an unsafe dynamic code execution pattern combined with broken access control.

Specifically, the console handler implements a "PHP console" by directly feeding request parameters into eval(), trusting them as executable PHP source.

Due to an include order issue and missing termination after a redirect, authentication checks in the admin panel do not effectively guard the AJAX endpoint, allowing unauthenticated traffic to reach the eval call.

This matches CWE-94: Improper Control of Generation of Code, where user input is treated as source code and executed at runtime without strict validation, isolation, or privilege constraints.

Potential impact

  • Remote execution of arbitrary PHP code on the server.
  • Complete compromise of the MajorDoMo application and its configuration.
  • Extraction or modification of sensitive data, including credentials or API keys accessible to the PHP process.
  • Installation of web shells or backdoors for persistent access.
  • Lateral movement within the hosting environment, depending on server privileges.
  • Use of the compromised host as a pivot for further attacks on internal networks.

General mitigation guidance

Effective mitigation focuses on removing unsafe code execution patterns and enforcing strict access boundaries around administrative functionality.

Recommended high-level patterns include:

  • Eliminate direct eval usage: Replace dynamic evaluation with whitelisted commands, parameterized operations, or explicit function dispatch tables. Avoid treating user input as code.
  • Isolate admin-only features: Ensure all admin console and debug features are strictly protected by robust authentication and authorization checks, enforced before any handler code runs.
  • Enforce early exits after redirects: After security-related redirects (e.g., on failed authentication), immediately terminate script execution (exit/die pattern) to prevent fall-through.
  • Remove register_globals-style patterns: Use explicit access to $_GET, $_POST, and other superglobals instead of global variable promotion, reducing accidental data flows into sensitive logic.
  • Apply least privilege: Run the web server and application with minimal filesystem and OS permissions, limiting the blast radius of any code execution flaw.
  • Restrict admin panel exposure: Place the admin interface behind VPNs, IP allowlists, or additional authentication layers to reduce the accessible attack surface.

How teams detect issues like this

Detection can rely on both code-centric and environment-centric approaches:

  • Static analysis: Configure static analyzers or linters to flag:
  • Usage of eval(), assert() with variable content, create_function(), or similar dynamic execution constructs.
  • Unauthenticated code paths leading to dynamic execution or high-privilege actions.
  • Redirect or authentication checks that do not terminate execution afterward.
  • Targeted code review: Focus manual review on:
  • Admin and debug modules, especially "console" or "shell" features.
  • Include/require ordering in entry-point scripts (e.g., admin.php) and their handler chains.
  • Any reliance on register_globals or mass-assignment patterns.
  • Runtime monitoring and logging:
  • Inspect web server logs for suspicious requests to /admin.php with ajax_panel, op, or command parameters from untrusted sources.
  • Use application or WAF rules to detect generic code injection patterns in query strings (e.g., PHP code fragments).
  • Policy enforcement:
  • Establish coding policies banning unsafe dynamic execution in production code.
  • Integrate automated checks in CI pipelines to block merges that introduce new instances of these patterns.

Sources

SourceLink
chocapikk.comchocapikk.com/posts/2026/majordomo-revisited/
github.comgithub.com/sergejey/majordomo/pull/1177
vulncheck.comvulncheck.com/advisories/majordomo-unauthenticated-remote-code-execution-via-admin-console-eval

Frequently asked

questions

Yes, if the MajorDoMo admin interface is exposed to the internet or any untrusted network, an attacker can send crafted HTTP requests to the vulnerable endpoint and trigger remote code execution without valid credentials.

No. The flaw exists specifically because authentication checks are bypassed due to the include order bug and missing exit after redirect, allowing unauthenticated requests to reach the eval-based console handler.

The safest pattern is to remove or redesign any feature that executes user-controlled input as code. Replace eval-based consoles with whitelisted, parameter-driven actions, ensure authentication and authorization are enforced before handlers run, and terminate execution after security-related redirects.

Avoid dynamic code evaluation in production features, enforce strict review of admin/debug functionality, prohibit register_globals-style patterns, and adopt secure coding policies backed by static analysis and CI checks to catch unsafe execution flows and broken access control early.

Find out what's already
exploitable in your codebase.