/

CVE-2026-36458

Severity:

CRITICAL RISK

(9.8)

SQL Injection in ChestnutCMS cms_content Tag Backend

CVE-2026-36458

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-94

Impact:

Database Compromise and Potential Remote Code Execution via SQL Injection

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

ChestnutCMS v1.5.10 contains a SQL injection flaw where the content parameter of the cms_content tag in the admin backend is directly injected into a SQL query during template rendering.

An attacker with access to the admin interface can manipulate this parameter to run arbitrary SQL statements against the underlying database, potentially leading to data theft, modification, or full application compromise.

Affected context

The vulnerability exists in the ChestnutCMS template rendering pipeline when admin users configure or edit templates that use the cms_content tag.

The content parameter is treated as trusted input and incorporated into a SQL query used to fetch or manipulate CMS content.

Deployments where administrators or elevated users can supply unvalidated or template-driven parameters that end up in SQL queries without sanitization are affected.

Exploit preconditions

  • Attack surface: Admin backend interface and any feature allowing configuration of the cms_content tag or its content parameter.
  • Required access: Authenticated access with permissions to create or modify templates, blocks, or widgets that use the cms_content tag.
  • Trigger point: Rendering of a template that includes a cms_content tag whose content parameter has been crafted with malicious SQL.
  • Why exploitation is possible: The content parameter is interpolated into a SQL statement without proper parameterization or escaping, allowing attacker-controlled values to alter the query structure.

Why this happens

The core issue is that user-controllable data from the admin backend (content parameter of cms_content) is concatenated or embedded into a SQL query instead of being passed as a bound parameter.

This aligns with the SQL injection bug class: data is treated as executable SQL syntax rather than as data, enabling an attacker to escape the intended query context and append arbitrary SQL operations.

Abstractly, any pattern where template- or configuration-driven values are used to dynamically build query strings without strong separation between code and data falls under this vulnerability category.

Potential impact

  • Extraction of sensitive data from CMS tables (users, content, configuration).
  • Modification or deletion of content, including defacement or data loss.
  • Creation or elevation of user accounts and roles at the database level.
  • Bypassing application-level authorization by manipulating query predicates.
  • In some environments, potential execution of OS-level commands via database-specific features or functions.

General mitigation guidance

Mitigation generally focuses on eliminating string-based query construction and enforcing strict separation between SQL code and data:

  • Use parameterized queries or prepared statements for all database access paths influenced by template or configuration data.
  • Introduce strict validation and whitelisting for tag parameters like content, allowing only expected patterns (e.g., identifiers, enums, or constrained filters) rather than arbitrary expressions.
  • Provide a higher-level, declarative API for templates to request content so that templates cannot directly influence raw SQL.
  • Apply least-privilege to the database account used by ChestnutCMS, restricting its ability to perform dangerous operations (e.g., DDL, OS interaction) where possible.
  • Treat admin-supplied template content as untrusted input and subject it to the same security controls as front-end user data.

How teams detect issues like this

Effective detection usually combines code-centric and operational approaches:

  • Static analysis rules to flag string concatenation or interpolation used to build SQL queries, especially where template or tag parameters are involved.
  • Code review checklists that call out dynamic query construction in template engines and CMS plugin/tag systems as a high-risk pattern.
  • Centralized database query logging and anomaly detection to identify unusual or complex queries originating from template rendering paths.
  • Security testing (including automated scanners and targeted penetration tests) focusing on admin template configuration features and custom tags.

Sources

SourceLink
github.comgithub.com/errors11/CVE/blob/main/CVE-2026-36458.md
github.comgithub.com/liweiyi/ChestnutCMS.git

Frequently asked

questions

Yes, if the admin backend is exposed and an attacker can obtain valid admin or elevated credentials, they can exploit this issue remotely by crafting malicious cms_content tag parameters.

The attacker needs at least the level of access required to create or modify templates or configurations that use the cms_content tag. In many CMS configurations, this corresponds to admin or editor roles.

The most robust fix is to refactor all affected code paths to use parameterized queries or a safe ORM API, and to disallow arbitrary SQL-like expressions in template parameters by validating against strict whitelists or predefined options.

Establish development standards that prohibit dynamic string-based SQL construction, enforce use of safe database abstraction layers, and require security review for any feature that lets templates or configuration influence query behavior.

Find out what's already
exploitable in your codebase.