/

CVE-2026-29096

Severity:

HIGH RISK

(8.1)

SQL Injection in SuiteCRM AOR_Reports Module

CVE-2026-29096

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Compromise and Potential 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

SuiteCRM's AOR_Reports module contains a second-order SQL injection issue where a user-controlled field_function value is stored in the database and later concatenated into a SQL SELECT query without sanitization.

Any authenticated user with access to the Reports feature can abuse this behavior to extract arbitrary database contents, and on MySQL instances with FILE privilege, this may be escalated to remote code execution via SELECT INTO OUTFILE.

Affected context

This vulnerability arises in SuiteCRM deployments where:

  • The AOR_Reports module is enabled and accessible to authenticated users.
  • Users are allowed to create or edit reports, causing their POSTed field_function data to be stored in the aor_fields table without validation.
  • Stored field_function values are later interpolated directly into SQL SELECT queries at report execution time.

The issue is most impactful where the CRM database contains sensitive data such as password hashes, API tokens, or configuration secrets, and where the underlying MySQL instance grants FILE or similarly powerful privileges.

Exploit preconditions

  • Attack surface: Web application interface for creating/editing and viewing SuiteCRM reports (AOR_Reports module).
  • Required access: Authenticated SuiteCRM account with permission to create or modify reports and to execute/view them later.
  • Trigger point: Execution or viewing of a crafted report, which causes the previously stored field_function value to be concatenated into a SQL SELECT statement.
  • Why exploitation is possible: User-controlled input is persisted directly into the aor_fields table and later used to dynamically build SQL queries without parameterization or server-side validation, enabling second-order SQL injection.

Why this happens

The root cause is the direct use of unvalidated, user-supplied data to construct SQL queries, matching CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

When a report is created or edited, the field_function parameter from POST data is stored as-is in the database. During report execution, this value is concatenated into a SELECT query string to define how fields are processed. Because no parameter binding, escaping, or whitelist validation is applied to field_function, an attacker can craft values that break out of the intended expression context and inject arbitrary SQL fragments.

This is a classic second-order injection pattern: the malicious payload is first stored and only becomes active when the application later reuses it in a security-sensitive context, making it harder to detect with naive input filtering.

Potential impact

  • Extraction of arbitrary database data, including:
  • User records and associated personal information
  • Authentication-related data such as password hashes
  • API keys, tokens, and configuration values stored in the database
  • Enumeration or modification of other tables, depending on database privileges.
  • On MySQL with FILE privilege:
  • Writing attacker-controlled files to the server filesystem via SELECT INTO OUTFILE.
  • Potential remote code execution by placing executable scripts or modifying application-related files.
  • Use of stolen secrets to pivot into other internal systems or third-party integrations.
  • Regulatory or contractual non-compliance due to exposure of customer or business-sensitive information.

General mitigation guidance

Long-term mitigation focuses on eliminating ad-hoc SQL string construction and enforcing strict control over dynamic query components:

  • Replace string concatenation with parameterized queries or query builder abstractions, ensuring that user-controlled values never directly form part of SQL syntax.
  • Treat field_function and similar "expression-like" fields as untrusted; apply allowlists of permitted functions and operators, or represent selectable functions as predefined identifiers rather than free-form text.
  • Introduce server-side validation and normalization for report configuration fields, rejecting or neutralizing any content that does not match an expected pattern or schema.
  • Reduce database privileges for the application user, avoiding FILE and other high-risk privileges where not strictly necessary.
  • Apply the principle of least privilege to SuiteCRM roles so that report creation/editing permissions are limited to trusted users.
  • Consider implementing a centralized query construction layer that enforces consistent escaping and parameterization, rather than building SQL directly within feature modules.

How teams detect issues like this

Effective detection will typically combine code-centric and behavior-centric approaches:

  • Static analysis: Configure SAST rules to flag:
  • Direct concatenation of variables (especially values read from the database) into SQL strings.
  • Dynamic query construction that bypasses parameterized APIs or ORM query builders.
  • Use of "expression" or "function" fields that feed directly into SQL without pattern checks.
  • Code review signals:
  • Any feature that stores user input and later reuses it in queries, report builders, or filters.
  • Custom reporting or analytics modules that allow users to define calculated fields or functions.
  • Database access code that constructs SELECT, UPDATE, or DELETE statements from multiple uncontrolled sources.
  • Runtime monitoring:
  • Database activity monitoring (DAM) to detect anomalous queries, such as those referencing unexpected tables, metadata tables, or file-related operations like SELECT INTO OUTFILE.
  • Application logs that capture executed report definitions and associated SQL templates for correlation and forensic analysis.
  • Automated governance:
  • CI/CD policies that block deploying code with flagged SQL concatenation patterns.
  • Periodic security assessments focusing on reporting/configuration modules that support user-defined expressions.

Sources

SourceLink
docs.suitecrm.comdocs.suitecrm.com/admin/releases/7.15.x
github.comgithub.com/SuiteCRM/SuiteCRM/security/advisories/GHSA-vh42-gmqm-q55m

Frequently asked

questions

Yes, if the SuiteCRM instance is exposed and an attacker can obtain any authenticated account with Reports access. The attack is performed entirely over HTTP(S) through the web interface for creating and viewing reports.

The attacker needs a valid SuiteCRM user account with permission to create or edit reports in the AOR_Reports module and to execute or view those reports. No database-level access is required; the application acts as the injection vector.

The most robust fix is to remove all dynamic SQL string concatenation that incorporates field_function and similar fields, replacing it with parameterized queries or a controlled query builder. In addition, enforce strict allowlists or structured representations for any user-selectable functions so that only predefined, vetted operations can be used in report definitions.

Design reporting and configuration features under the assumption that all user input, including stored configuration values, is untrusted. Use parameterized queries exclusively, avoid passing arbitrary user-controlled strings into SQL syntax positions, define schemas and allowlists for dynamic options, and integrate static analysis and security review into the development lifecycle for any module that constructs queries dynamically.

Find out what's already
exploitable in your codebase.