MEDIUM · CVSS 3.1 4.8 EPSS 0.3% · 25th percentile CWE-681

CVE-2026-128084: sqlite3-ruby: Possible SQL query truncation when a string is 4 GiB or larger

Published 2026-11-13 · Updated 2026-11-13 · Also known as GHSA-4fqr-96q8-xrfx

Summary

The sqlite3-ruby library casts Ruby string lengths to a 32-bit integer, causing SQL query truncation when strings reach or exceed 4 GiB. Engineering and security teams using the RubyGems sqlite3 package must update to version 2.10.2 or later.

Who is affected

Affected deployments are those using sqlite3-ruby on 64-bit platforms where attackers can control strings or bound values of 4 GiB or larger. Exploitation can truncate SQL queries or bound parameters by wrapping the length, potentially dropping trailing clauses like WHERE statements. However, successful exploitation requires holding massive strings in memory and bypassing typical application request body size limits.

Exploitability

The vulnerability has a CVSS base score of 4.8 with a medium severity rating, requiring high attack complexity over network vectors with no privileges required. The current EPSS score is 0.003 (0.248th percentile), and it is not listed in the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
RubyGems sqlite3 >= 0, < 2.10.2 2.10.2 bundle update sqlite3

CVSS 3.1 vector

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

Attack vectorNetwork
Attack complexityHigh
Privileges requiredNone
User interactionNone
ScopeUnchanged
ConfidentialityLow
IntegrityLow
AvailabilityNone

FAQ

What causes the truncation in sqlite3-ruby?

The library casts Ruby string lengths from long to int before passing them to SQLite, causing values of 4 GiB or larger to wrap around modulo 2^32.

Which methods are affected by this vulnerability?

Affected paths include Database#prepare, #execute, Statement#bind_param, and custom SQL functions or aggregates defined via Database#create_function and #create_aggregate.

Is there any active exploitation in the wild?

No active exploitation is documented, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.

Original advisory description
### Summary sqlite3-ruby cast Ruby string lengths (`long`) to `int` before passing them to SQLite. On 64-bit platforms, a string of 4 GiB (2^32 bytes) or larger had its length wrap, so SQLite saw only the first `length mod 2^32` bytes. An attacker who controls the length of a SQL string could truncate the query, for example dropping a trailing `WHERE` clause. The affected paths are: - the SQL passed to `Database#prepare`, `#execute`, and related methods - String and Blob values passed to `Statement#bind_param` and related methods - String and Blob values returned from SQL functions and aggregates defined in Ruby (`Database#create_function`, `#create_aggregate`, and related methods) sqlite3 v2.10.2 raises `RangeError` when any of these strings is longer than `INT_MAX` bytes. ### Severity The sqlite3-ruby maintainers have evaluated this as medium severity (CVSS 4.8). Exploitation requires an attacker to get at least 4 GiB into a single SQL string or bound value. Most deployments reject a request body that large before the application sees it, and the server must hold several copies of the string in memory. A truncated bound value is only a prefix of the attacker's input, so the bind paths matter only where the application validated the full value. A truncated SQL string is more serious: when the attacker's input is inlined into the SQL, the clauses that follow it are dropped. If a dropped clause contained a bind placeholder, binding raises `SQLite3::RangeException` instead of running the query. ### Mitigation Upgrade to sqlite3 v2.10.2 or later. As a workaround for earlier versions, reject SQL strings and bound values of 4 GiB or larger before passing them to sqlite3-ruby, or limit request body size well below 4 GiB. ### Credit This issue was responsibly reported by Luke Jahnke from elttam.

References

Source records: GHSA-4fqr-96q8-xrfx (OSV.dev) · EPSS by FIRST, 2026-11-21.