/

CVE-2026-66748

Severity:

HIGH RISK

(8.8)

Ruby Code Injection (CWE-94) in Camaleon CMS Fields

CVE-2026-66748

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Authenticated Remote Code Execution

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

Camaleon CMS contains an authenticated remote code execution flaw where attacker-controlled Ruby expressions in custom field options are evaluated on post edit pages.

Users with the ability to manage custom_fields can inject malicious Ruby code into the select_eval field type, leading to arbitrary server-side code execution under web server privileges.

Camaleon CMS contains an authenticated remote code execution flaw where attacker-controlled Ruby expressions in custom field options are evaluated on post edit pages.

Users with the ability to manage custom_fields can inject malicious Ruby code into the select_eval field type, leading to arbitrary server-side code execution under web server privileges.

Affected context

This vulnerability appears in Camaleon CMS deployments that:

  • Enable and use the custom_fields feature
  • Grant users the "custom_fields manage" permission or similar elevated content configuration rights
  • Use the select_eval custom field type, which relies on dynamic Ruby evaluation in ERB views

The issue is triggered when a post edit page is rendered and the system processes the attacker-supplied expression from the field options.

This vulnerability appears in Camaleon CMS deployments that:

  • Enable and use the custom_fields feature
  • Grant users the "custom_fields manage" permission or similar elevated content configuration rights
  • Use the select_eval custom field type, which relies on dynamic Ruby evaluation in ERB views

The issue is triggered when a post edit page is rendered and the system processes the attacker-supplied expression from the field options.

Exploit preconditions

  • Attack surface: Administrative or privileged web interface for managing custom fields and editing posts
  • Required access: Authenticated CMS account with permission to manage custom_fields (or compromise of such an account)
  • Trigger point: Rendering of a post edit page that includes a select_eval custom field whose options contain the malicious expression
  • Why exploitation is possible: The CMS passes untrusted field option data directly into instance_eval within an ERB view, allowing arbitrary Ruby code execution without validation or sandboxing
  • Attack surface: Administrative or privileged web interface for managing custom fields and editing posts
  • Required access: Authenticated CMS account with permission to manage custom_fields (or compromise of such an account)
  • Trigger point: Rendering of a post edit page that includes a select_eval custom field whose options contain the malicious expression
  • Why exploitation is possible: The CMS passes untrusted field option data directly into instance_eval within an ERB view, allowing arbitrary Ruby code execution without validation or sandboxing

Why this happens

The underlying bug stems from treating configuration-like data as executable code.

In this case, the select_eval custom field type stores Ruby expressions in its options and later evaluates them using instance_eval during view rendering.

This aligns with CWE-94: Improper Control of Generation of Code, where untrusted input is allowed to influence dynamically generated code that the application subsequently executes.

The insecure pattern is the direct use of dynamic evaluation APIs (instance_eval) on data that can be modified by users with elevated but not necessarily fully trusted roles, without strict whitelisting or static expression constraints.

The underlying bug stems from treating configuration-like data as executable code.

In this case, the select_eval custom field type stores Ruby expressions in its options and later evaluates them using instance_eval during view rendering.

This aligns with CWE-94: Improper Control of Generation of Code, where untrusted input is allowed to influence dynamically generated code that the application subsequently executes.

The insecure pattern is the direct use of dynamic evaluation APIs (instance_eval) on data that can be modified by users with elevated but not necessarily fully trusted roles, without strict whitelisting or static expression constraints.

Potential impact

  • Attackers may execute arbitrary Ruby code on the server within the web application process.
  • They could access or modify application data, including posts, users, and configuration settings.
  • They can potentially read sensitive files or environment variables accessible to the web server.
  • They may pivot to broader system compromise depending on server configuration and available libraries.
  • They could deploy backdoors or create persistent malicious logic within the CMS environment.
  • Attackers may execute arbitrary Ruby code on the server within the web application process.
  • They could access or modify application data, including posts, users, and configuration settings.
  • They can potentially read sensitive files or environment variables accessible to the web server.
  • They may pivot to broader system compromise depending on server configuration and available libraries.
  • They could deploy backdoors or create persistent malicious logic within the CMS environment.

General mitigation guidance

Effective mitigation focuses on eliminating unsafe dynamic code evaluation paths and tightening trust boundaries for configuration fields.

Common defensive patterns include:

  • Removing or redesigning features that rely on evaluating user-supplied code (e.g., avoid instance_eval on field options).
  • Constraining dynamic behavior to a small, well-defined set of declarative options rather than arbitrary Ruby expressions.
  • Applying strict validation, whitelisting, or expression parsing that cannot produce executable code.
  • Separating high-risk configuration capabilities (like advanced dynamic fields) from general administrative roles and limiting them to highly trusted operators.
  • Running the application with least-privilege OS accounts and minimizing accessible system resources to reduce blast radius if evaluation does occur.

Effective mitigation focuses on eliminating unsafe dynamic code evaluation paths and tightening trust boundaries for configuration fields.

Common defensive patterns include:

  • Removing or redesigning features that rely on evaluating user-supplied code (e.g., avoid instance_eval on field options).
  • Constraining dynamic behavior to a small, well-defined set of declarative options rather than arbitrary Ruby expressions.
  • Applying strict validation, whitelisting, or expression parsing that cannot produce executable code.
  • Separating high-risk configuration capabilities (like advanced dynamic fields) from general administrative roles and limiting them to highly trusted operators.
  • Running the application with least-privilege OS accounts and minimizing accessible system resources to reduce blast radius if evaluation does occur.

How teams detect issues like this

Organizations can detect similar issues by:

  • Using static analysis rules to flag direct use of eval, instance_eval, or similar dynamic execution APIs, especially in paths influenced by user or admin input.
  • Reviewing code for features that store executable code snippets in database fields or configuration options and are later evaluated at runtime.
  • Implementing secure coding guidelines that disallow arbitrary code evaluation in templating and field configuration logic, enforced via code review checklists.
  • Applying runtime application security monitoring to detect anomalous execution patterns or unexpected method calls triggered during view rendering.

Organizations can detect similar issues by:

  • Using static analysis rules to flag direct use of eval, instance_eval, or similar dynamic execution APIs, especially in paths influenced by user or admin input.
  • Reviewing code for features that store executable code snippets in database fields or configuration options and are later evaluated at runtime.
  • Implementing secure coding guidelines that disallow arbitrary code evaluation in templating and field configuration logic, enforced via code review checklists.
  • Applying runtime application security monitoring to detect anomalous execution patterns or unexpected method calls triggered during view rendering.

Sources

SourceLink
enrik-m.github.ioenrik-m.github.io/posts/Camaleon-CMS-Vulnerabilties/
github.comgithub.com/owen2345/camaleon-cms/commit/158823668e2e5c3114a69b34cf1c96cb41533c5f
github.comgithub.com/owen2345/camaleon-cms/pull/1136
github.comgithub.com/owen2345/camaleon-cms/releases/tag/2.9.2
github.comgithub.com/theopaid/Camaleon-CMS---Authenticated-RCE-via-select_eval-Custom-Field
tpaidakis.comtpaidakis.com/writeups/camaleon-cms-rce-select-eval/
vulncheck.comvulncheck.com/advisories/camaleon-cms-authenticated-rce-via-select-eval-custom-field

Frequently asked

questions

Yes, it can be exploited remotely through the web interface, but the attacker must be authenticated and have sufficient privileges to manage custom_fields or control an account with that permission.

The attacker needs an authenticated CMS account with the custom_fields manage permission, or a way to compromise such an account. Ordinary content authors without access to field configuration generally cannot exploit it directly.

The safest approach is to remove or replace any functionality that evaluates user-supplied expressions, avoiding APIs like instance_eval entirely. Use declarative configuration (e.g., predefined options, non-executable templates) instead of dynamic code execution.

Avoid designing features that treat user or admin input as executable code, enforce coding standards that forbid runtime code evaluation, and include security-focused code review and static analysis checks to catch use of dynamic evaluation constructs early in the development lifecycle.

Yes, it can be exploited remotely through the web interface, but the attacker must be authenticated and have sufficient privileges to manage custom_fields or control an account with that permission.

The attacker needs an authenticated CMS account with the custom_fields manage permission, or a way to compromise such an account. Ordinary content authors without access to field configuration generally cannot exploit it directly.

The safest approach is to remove or replace any functionality that evaluates user-supplied expressions, avoiding APIs like instance_eval entirely. Use declarative configuration (e.g., predefined options, non-executable templates) instead of dynamic code execution.

Avoid designing features that treat user or admin input as executable code, enforce coding standards that forbid runtime code evaluation, and include security-focused code review and static analysis checks to catch use of dynamic evaluation constructs early in the development lifecycle.

Find out what's already
exploitable in your codebase.