/

CVE-2026-34717

Severity:

CRITICAL RISK

(9.9)

SQL Injection in OpenProject Reporting =n Operator

CVE-2026-34717

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution / Data Compromise

Severity:

CRITICAL RISK

(9.9)

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

The reporting module in OpenProject embeds user-supplied values from the =n operator directly into SQL WHERE clauses without parameterization, enabling SQL injection.

Under typical configurations, an attacker who can craft reporting filters may inject arbitrary SQL, potentially accessing or modifying data across the OpenProject database.

Affected context

This vulnerability occurs in OpenProject's reporting feature, specifically within the implementation of the =n operator in modules/reporting/lib/report/operator.rb.

It is relevant when:

  • The reporting module is enabled and used to build/filter reports
  • User-controlled input is passed into the =n operator
  • Database queries are constructed dynamically using these operator values

In such contexts, insufficient query parameterization allows crafted inputs to flow directly into SQL WHERE clauses.

Exploit preconditions

  • Attack surface: Web interface endpoints that use the reporting engine and accept user-defined filters or parameters.
  • Required access: Ability to authenticate or otherwise submit inputs that reach the reporting =n operator (often a regular application user with reporting access).
  • Trigger point: Creation, modification, or execution of reports that apply filters using the =n operator with attacker-controlled values.
  • Why exploitation is possible: The implementation concatenates raw user input into SQL WHERE clauses rather than using bound parameters or proper escaping, so attacker-controlled tokens are interpreted as SQL syntax.

Why this happens

The underlying bug is a classic SQL injection pattern mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

In the reporting module, the =n operator constructs SQL fragments by directly interpolating user input into a query string.

Because the code does not use prepared statements or parameter binding, it fails to treat input as data only; instead, user-controlled text becomes part of the SQL command, allowing attackers to alter query structure, bypass filters, or execute additional SQL operations.

Potential impact

  • Read access to sensitive project and user data that the database role can query
  • Unauthorized modification or deletion of tasks, issues, projects, or configuration records
  • Escalation of privileges by manipulating authorization-related tables
  • Creation of backdoor accounts or persistence mechanisms at the data layer
  • Potential full compromise of the OpenProject database instance associated with the application

General mitigation guidance

Effective mitigation focuses on eliminating dynamic SQL construction from user input and enforcing strict separation between code and data:

  • Use parameterized queries or ORM query builders for all reporting filters, including custom operators like =n
  • Avoid string concatenation when building WHERE clauses; treat all external input as untrusted data
  • Centralize query-building logic so that all operators pass through a common, parameterized interface
  • Apply strict whitelisting for allowed operators and column names, and avoid passing unvalidated identifiers from user input
  • Run the database with least-privilege accounts so that even if a query is abused, damage is constrained

How teams detect issues like this

Detection typically combines code-level review with runtime monitoring:

  • Static analysis: Configure rules that flag dynamic SQL construction, string interpolation in query methods, and use of raw SQL APIs with user-controlled variables.
  • Code review: Examine reporting and filter-building code paths for any operator that manually assembles WHERE clauses or accepts raw SQL fragments.
  • Security testing: Use automated and manual testing to supply unexpected SQL metacharacters in reporting filters and observe for errors or anomalies.
  • Runtime monitoring: Monitor database logs for unusual query patterns, concatenated literals, or repeated failed queries stemming from reporting endpoints.

Sources

SourceLink
github.comgithub.com/opf/openproject/releases/tag/v17.2.3
github.comgithub.com/opf/openproject/security/advisories/GHSA-5rrm-6qmq-2364

Frequently asked

questions

Yes. Any remote user who can access the reporting functionality and control inputs that reach the =n operator may be able to exploit SQL injection through the web interface.

In most deployments, access to reporting requires an authenticated user account, so exploitation generally assumes at least low-privileged access. The exact requirement depends on how OpenProject permissions and report access are configured.

The safest pattern is to ensure that all SQL in the reporting module is built using parameterized queries or ORM abstractions, preventing user input from ever being concatenated into raw SQL strings. Inputs should be treated strictly as parameters, not as SQL fragments.

Adopt a development policy that forbids dynamic SQL string construction with user input, enforce the use of prepared statements and query builders, and integrate static analysis and security review gates that specifically flag injection-prone patterns in new or modified code.

Find out what's already
exploitable in your codebase.