/

CVE-2026-110911

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Wheels Dynamic Query APIs

CVE-2026-110911

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access and Data Exposure

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

A SQL injection vulnerability in Wheels causes caller-supplied quoted values to be parsed incorrectly by dynamic finders, query-builder methods, key-based lookups, and uniqueness validation. Applications that pass request data into these APIs may allow attackers to alter database queries and access authentication records, password-reset data, tokens, or other protected information.

A SQL injection vulnerability in Wheels causes caller-supplied quoted values to be parsed incorrectly by dynamic finders, query-builder methods, key-based lookups, and uniqueness validation. Applications that pass request data into these APIs may allow attackers to alter database queries and access authentication records, password-reset data, tokens, or other protected information.

Affected context

The vulnerability affects Wheels applications using dynamic query APIs in the affected 1.1.8 through 4.1.1 release range. Risk is greatest where request-controlled strings, UUIDs, email addresses, dates, or other values are passed directly to finders, key-based operations, uniqueness checks, or query-builder methods without an additional trusted query-construction boundary. Numeric-column values are not affected by the described parsing issue. A related concern exists in whereBetween() for string or date bounds under MySQL or MariaDB configurations with backslash escaping enabled.

The vulnerability affects Wheels applications using dynamic query APIs in the affected 1.1.8 through 4.1.1 release range. Risk is greatest where request-controlled strings, UUIDs, email addresses, dates, or other values are passed directly to finders, key-based operations, uniqueness checks, or query-builder methods without an additional trusted query-construction boundary. Numeric-column values are not affected by the described parsing issue. A related concern exists in whereBetween() for string or date bounds under MySQL or MariaDB configurations with backslash escaping enabled.

Exploit preconditions

  • Attack surface: Application endpoints or services that invoke Wheels dynamic finders, query-builder methods, key-based lookup operations, or uniqueness validation.
  • Required access: The ability to submit or influence values that reach one of the affected query APIs; authentication may not be required if the exposed endpoint is public.
  • Trigger point: Construction and execution of a database query using caller-supplied quoted values, including string or UUID keys and, in the related case, string or date range bounds.
  • Why exploitation is possible: The parser incorrectly interprets a doubled single quote as the end of a SQL literal, allowing crafted input to change the intended query structure.
  • Attack surface: Application endpoints or services that invoke Wheels dynamic finders, query-builder methods, key-based lookup operations, or uniqueness validation.
  • Required access: The ability to submit or influence values that reach one of the affected query APIs; authentication may not be required if the exposed endpoint is public.
  • Trigger point: Construction and execution of a database query using caller-supplied quoted values, including string or UUID keys and, in the related case, string or date range bounds.
  • Why exploitation is possible: The parser incorrectly interprets a doubled single quote as the end of a SQL literal, allowing crafted input to change the intended query structure.

Why this happens

The underlying bug is an incorrect escaping and quote-boundary implementation in the SQL-generation path. Instead of treating doubled single quotes as data inside a literal, the parser can terminate the literal early when processing caller-supplied values. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, because untrusted input can influence SQL syntax rather than remaining constrained to a parameter value.

The underlying bug is an incorrect escaping and quote-boundary implementation in the SQL-generation path. Instead of treating doubled single quotes as data inside a literal, the parser can terminate the literal early when processing caller-supplied values. This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, because untrusted input can influence SQL syntax rather than remaining constrained to a parameter value.

Potential impact

  • An attacker may bypass authentication or account-recovery lookup conditions.
  • Password-reset tokens, session-related data, or other secrets could be disclosed.
  • Unauthorized records may be read or selected through affected query paths.
  • Database records could potentially be modified or deleted where the exposed operation permits it.
  • Application integrity and confidentiality could be compromised.
  • An attacker may bypass authentication or account-recovery lookup conditions.
  • Password-reset tokens, session-related data, or other secrets could be disclosed.
  • Unauthorized records may be read or selected through affected query paths.
  • Database records could potentially be modified or deleted where the exposed operation permits it.
  • Application integrity and confidentiality could be compromised.

General mitigation guidance

Mitigation generally focuses on ensuring that caller-controlled values cannot alter SQL syntax.

Common defensive patterns include:

  • Use parameterized queries or framework query APIs that preserve values as bound parameters rather than interpolating SQL fragments.
  • Treat dynamic property names, operators, sort expressions, and lookup modes as allowlisted application-controlled values.
  • Apply strict type and format validation to identifiers, UUIDs, email addresses, dates, and range boundaries before they reach query construction.
  • Avoid passing raw request parameters directly into dynamic finders or query-builder expressions.
  • Apply least-privilege database accounts so application queries have only the permissions they require.
  • Use database-specific escaping only as a secondary defense, not as a substitute for parameter binding.
  • Review MySQL and MariaDB SQL-mode and escaping settings when range queries accept string or date bounds.

Mitigation generally focuses on ensuring that caller-controlled values cannot alter SQL syntax.

Common defensive patterns include:

  • Use parameterized queries or framework query APIs that preserve values as bound parameters rather than interpolating SQL fragments.
  • Treat dynamic property names, operators, sort expressions, and lookup modes as allowlisted application-controlled values.
  • Apply strict type and format validation to identifiers, UUIDs, email addresses, dates, and range boundaries before they reach query construction.
  • Avoid passing raw request parameters directly into dynamic finders or query-builder expressions.
  • Apply least-privilege database accounts so application queries have only the permissions they require.
  • Use database-specific escaping only as a secondary defense, not as a substitute for parameter binding.
  • Review MySQL and MariaDB SQL-mode and escaping settings when range queries accept string or date bounds.

How teams detect issues like this

Detection can combine code review, automated analysis, and runtime monitoring:

  • Search for request, form, JSON, or header values flowing into dynamic finders, where(), whereBetween(), key-based operations, or uniqueness validation.
  • Flag query construction that concatenates or interpolates values into SQL strings.
  • Review uses of findOneByEmail, findByKey, updateByKey, deleteByKey, and findOrCreateBy... where arguments originate outside trusted application logic.
  • Add static-analysis or taint-tracking rules for untrusted input reaching database query APIs.
  • Use policy checks in CI to require parameterized query construction and approved database-access abstractions.
  • Monitor database logs for malformed quoting, unexpected predicates, unusual lookup patterns, or query behavior inconsistent with normal application workflows.

Detection can combine code review, automated analysis, and runtime monitoring:

  • Search for request, form, JSON, or header values flowing into dynamic finders, where(), whereBetween(), key-based operations, or uniqueness validation.
  • Flag query construction that concatenates or interpolates values into SQL strings.
  • Review uses of findOneByEmail, findByKey, updateByKey, deleteByKey, and findOrCreateBy... where arguments originate outside trusted application logic.
  • Add static-analysis or taint-tracking rules for untrusted input reaching database query APIs.
  • Use policy checks in CI to require parameterized query construction and approved database-access abstractions.
  • Monitor database logs for malformed quoting, unexpected predicates, unusual lookup patterns, or query behavior inconsistent with normal application workflows.

Sources

SourceLink
github.comgithub.com/wheels-dev/wheels/security/advisories/GHSA-96rm-h22v-925x

Frequently asked

questions

It can be remotely exploitable when a public or authenticated application endpoint passes attacker-controlled values to an affected Wheels query API. Exploitability depends on the application's data flow and exposed operations.

Not necessarily. Public login, password-reset, token-validation, or lookup endpoints may be affected without prior authentication. Other paths may require a valid account or application-specific permissions.

Keep caller-controlled values as bound parameters and use query APIs that do not permit those values to become SQL syntax. Dynamic identifiers and operators should be selected from fixed allowlists.

Combine parameterized database access, strict input and type validation, taint-aware code review, least-privilege database permissions, and automated tests covering quote-handling and query-boundary behavior.

It can be remotely exploitable when a public or authenticated application endpoint passes attacker-controlled values to an affected Wheels query API. Exploitability depends on the application's data flow and exposed operations.

Not necessarily. Public login, password-reset, token-validation, or lookup endpoints may be affected without prior authentication. Other paths may require a valid account or application-specific permissions.

Keep caller-controlled values as bound parameters and use query APIs that do not permit those values to become SQL syntax. Dynamic identifiers and operators should be selected from fixed allowlists.

Combine parameterized database access, strict input and type validation, taint-aware code review, least-privilege database permissions, and automated tests covering quote-handling and query-boundary behavior.

Find out what's already
exploitable in your codebase.