/

CVE-2026-27760

Severity:

HIGH RISK

(8.1)

Code Injection in OpenCATS Installer AJAX Endpoint

CVE-2026-27760

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.1)

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

OpenCATS prior to commit 3002a29 contains a PHP code injection flaw in the installer's AJAX endpoint that processes the databaseConnectivity action parameter without proper sanitization.

An unauthenticated attacker can inject PHP statements that are written into config.php, causing malicious code to persist and execute on every subsequent page load while the installation wizard remains incomplete.

Affected context

This vulnerability affects OpenCATS instances that are running the installation wizard and have not yet completed the setup process.

In this state, the installer AJAX endpoint accepts parameters such as databaseConnectivity and writes them into config.php within a define() string context.

Because user-controlled data is embedded into PHP source without robust escaping or validation, an attacker who can reach the installer endpoint over HTTP can influence the generated configuration file.

Exploit preconditions

  • Attack surface: Public-facing or network-accessible OpenCATS installation wizard.
  • Required access: No authentication is required; attacker only needs HTTP access to the installer AJAX endpoint.
  • Trigger point: Submission of crafted input to the databaseConnectivity action parameter, which is then incorporated into config.php.
  • Why exploitation is possible: The installer concatenates untrusted user input into a PHP define() call in config.php using string delimiters without enforcing strict escaping or validation. By injecting a single quote and a statement terminator, the attacker breaks out of the string and appends arbitrary PHP code that will be evaluated on subsequent requests.

Why this happens

The core issue is direct embedding of untrusted input into executable PHP source during configuration generation.

The installer builds config.php by concatenating user-provided values into define() statements, assuming they are inert strings. This violates separation between data and code: when input is not correctly escaped or restricted, control characters like quotes and semicolons allow the injected content to escape the string context and introduce new PHP statements.

This behavior maps to CWE-94: Improper Control of Generation of Code (Code Injection), where dynamic code generation uses attacker-controlled data without adequate validation, escaping, or a safe templating mechanism.

Potential impact

  • Execution of arbitrary PHP code with the privileges of the web server process.
  • Installation of backdoors or web shells that persist across requests.
  • Compromise of application data, including candidate records and user accounts.
  • Lateral movement within the hosting environment or access to other applications on the same server.
  • Abuse of the compromised server as a platform for further attacks or spam campaigns.

General mitigation guidance

Effective mitigation relies on eliminating direct code generation from untrusted input and constraining what configuration values are allowed:

  • Use non-executable configuration formats (e.g., JSON, INI, or environment variables) instead of generating PHP code with user data.
  • Where PHP-based config files must be used, treat user input as data only: ensure all values are strictly validated against expected patterns (e.g., hostnames, ports, booleans) and safely escaped before insertion.
  • Avoid concatenating raw user input into PHP constructs; use fixed templates with placeholders and a minimal whitelist of allowed characters for each field.
  • Restrict access to the installer endpoints so they are not exposed on production systems once installation is complete.
  • Run the web server and application under least-privilege accounts and limit filesystem write permissions to reduce the blast radius of any misconfiguration.

How teams detect issues like this

Detection typically combines code-level analysis and runtime monitoring:

  • Static analysis and code review:
  • Flag locations where application code dynamically writes or generates PHP files using user-controlled data.
  • Look for patterns of string concatenation building PHP constructs (define(), eval, include paths) from request parameters.
  • Enforce review policies requiring strict validation of installer and setup logic that manipulates configuration files.
  • Policy enforcement:
  • Require use of non-executable configuration formats for new components.
  • Add CI checks or automated tools to identify new code that writes executable configuration from HTTP parameters.
  • Runtime monitoring:
  • Monitor for unexpected changes to config.php and other critical configuration files.
  • Use file integrity monitoring (FIM) to alert on modifications during or after installation.

Sources

SourceLink
chocapikk.comchocapikk.com/posts/2026/opencats-installer-rce/
github.comgithub.com/opencats/OpenCATS/blob/46e4727/lib/CATSUtility.php#L142-L172
github.comgithub.com/opencats/OpenCATS/blob/46e4727/modules/install/ajax/ui.php#L130
github.comgithub.com/opencats/OpenCATS/commit/3002a29f4c3cada1aa2c4f3d4ae4e189906606b6
github.comgithub.com/opencats/OpenCATS/pull/706
vulncheck.comvulncheck.com/advisories/opencats-php-code-injection-via-installer-ajax-endpoint

Frequently asked

questions

Yes. As long as the installation wizard is accessible over the network, an unauthenticated remote attacker can send crafted requests to the installer AJAX endpoint and attempt code injection.

No. The described flaw affects an unauthenticated endpoint during the installation phase, so no login is required to supply malicious databaseConnectivity parameters.

The safest pattern is to stop generating executable PHP from user input entirely: use a non-executable configuration format or a rigid template that only inserts strictly validated, escaped data into non-code positions. Additionally, ensure the installer is disabled or restricted after initial setup.

Maintain a strict separation between code and data, avoid dynamic code generation based on HTTP parameters, validate all configuration inputs against tight whitelists, and incorporate automated checks in your development pipeline that flag any code writing executable scripts from request data.

Find out what's already
exploitable in your codebase.