/

CVE-2026-13766

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) via Unquoted Identifiers in DBIx::QuickORM

CVE-2026-13766

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Data Exposure and Tampering 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

DBIx::QuickORM before version 0.000026 is vulnerable to SQL injection because caller-supplied SQL identifiers are emitted into queries without quoting or sanitization.

When untrusted input is forwarded into identifier positions such as order_by, column lists, or join aliases, an attacker can manipulate query structure to disclose or tamper with data beyond the intended scope.

Affected context

This vulnerability arises in Perl applications that use DBIx::QuickORM's default SQL builder, a SQL::Abstract subclass, without explicitly configuring safe identifier quoting.

It becomes relevant when application code passes user-controlled or otherwise untrusted values into identifier-bearing parameters, including order_by, where-clause column keys, field and returning lists, upsert columns, or join aliases.

In such cases, identifiers are emitted verbatim into the SQL string while values are safely placeholder-bound, creating a split trust model where the query shape can be manipulated even though data values appear parametrized.

Exploit preconditions

  • Attack surface: Application endpoints or interfaces that accept dynamic query parameters (sorting, filtering, field selection, joins) and forward them into DBIx::QuickORM identifier positions.
  • Required access: Ability to supply or influence identifier-like input (e.g., column names, sort keys, or alias strings) processed by the ORM or query builder.
  • Trigger point: Query construction via the default SQL builder where bindtype is set but quote_char is not, causing SQL::Abstract to emit identifiers directly into the SQL.
  • Why exploitation is possible: The query builder parameterizes values but not identifiers, treating caller-supplied identifiers as trusted; this enables crafted input to alter ORDER BY, WHERE, UPDATE, and JOIN clauses, effectively injecting new SQL fragments.

Why this happens

The underlying flaw is the inconsistent treatment of input components in query construction: values are safely bound as parameters, but identifiers are interpolated as raw SQL without quoting.

DBIx::QuickORM's default SQL builder configures bindtype in its constructor yet leaves quote_char unset, causing SQL::Abstract to assume identifiers are safe and emit them verbatim.

This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where attacker-controlled identifier input can introduce new clauses or expressions into the query, despite the presence of parameterization for value data.

Potential impact

  • Attackers may alter row ordering using sub-selects or expressions referencing columns not originally intended to be part of the query.
  • Attackers could craft WHERE clause identifier input to read additional columns or manipulate logical conditions, increasing data disclosure.
  • UPDATE and upsert identifier positions may be abused to target different columns or tables, enabling data tampering.
  • JOIN aliases and column lists may be manipulated to expand data sets, correlate sensitive information, or bypass application-level access controls.
  • Overall, successful exploitation can lead to unauthorized read and write access to database contents beyond the intended query scope.

General mitigation guidance

Effective mitigation focuses on enforcing strict separation between trusted query structure and untrusted input, especially for SQL identifiers.

Common defensive patterns include:

  • Avoiding direct use of user-controlled data as SQL identifiers; instead, map untrusted values through vetted, finite enumerations of allowed column names and sort keys.
  • Configuring query builders and ORMs to quote or escape identifiers consistently (e.g., setting appropriate quote_char) so even trusted identifiers are handled safely.
  • Centralizing query construction logic to avoid ad hoc identifier concatenation spread across the codebase, making policy enforcement easier.
  • Applying least-privilege database roles so even if query shape is influenced, accessible tables and operations remain constrained.
  • Designing APIs that expose semantic operations (e.g., "sort by date" or "filter by status") rather than raw SQL-centric parameters, thereby reducing the need to process free-form identifiers from users.

How teams detect issues like this

Detection generally involves scrutinizing how query structure and identifiers are derived within the application:

  • Static analysis can flag data flows where user input or untrusted parameters reach identifier-related arguments (order_by, column lists, join aliases) of DBIx::QuickORM or SQL::Abstract.
  • Code review should look for dynamic construction of column names, table names, or ORDER BY clauses from request parameters without validation or mapping to a known-safe set.
  • Security tests and fuzzing can attempt to inject SQL fragments via sort keys or filter identifiers to observe whether query structure changes, even when values appear parametrized.
  • Policy-based checks in CI/CD (including automated review tools) can enforce conventions such as "no unvalidated strings passed as identifiers" and "ORM builders must be configured with safe identifier quoting."

Sources

SourceLink
github.comgithub.com/exodist/DBIx-QuickORM/commit/43d7684682050780f056f25e1879191fb0a3265e.patch
metacpan.orgmetacpan.org/release/EXODIST/DBIx-QuickORM-0.000026/changes
openwall.comopenwall.com/lists/oss-security/2026/06/30/4

Frequently asked

questions

Exploitability depends on how the application exposes query customization to users. If endpoints accept arbitrary sort keys, field lists, or similar parameters and pass them through to DBIx::QuickORM without mapping or validation, an attacker can reliably influence the query structure and perform SQL injection.

The attacker needs the ability to supply or control values that are used as SQL identifiers by the ORM, such as user-controlled order_by values or filter keys. No direct database access is required; exploitation occurs through the application interface that forwards these parameters.

The safest pattern is to stop treating arbitrary strings as identifiers. Instead, use a whitelist or mapping from user-friendly tokens to hard-coded, vetted column names, and configure the query builder to quote identifiers consistently. This ensures that only expected query shapes are generated and that both identifiers and values are handled safely.

Future prevention relies on designing APIs that never expose raw SQL concepts to end users, enforcing validation and whitelisting for any dynamic query aspect, and standardizing ORM configuration for safe identifier handling. Complement these practices with regular secure code reviews and automated checks that track untrusted data into query construction paths.

Find out what's already
exploitable in your codebase.