{"id":"CVE-2026-128084","aliases":["CVE-2026-128084","GHSA-4fqr-96q8-xrfx"],"related":[],"kind":"vulnerability","state":"published","title":"sqlite3-ruby: SQL Query Truncation","summary":"sqlite3 provides Ruby bindings for the SQLite3 embedded database. Prior to 2.10.2, sqlite3-ruby casts Ruby string lengths to int before passing SQL through Database#prepare, bound String or Blob values through Statement#bind_param, and String or Blob results from Ruby-defined SQL functions and aggregates through Database#create_function and Database#create_aggregate. On 64-bit platforms, a string of 4 GiB (2^32 bytes) or larger can wrap the length so SQLite processes only a prefix. A truncated SQL string can drop trailing clauses such as a WHERE condition, while a truncated bound value matters only when the application validated the full value before binding it. Exploitation requires the application and server to accept and retain the unusually large attacker-controlled string. If a dropped SQL clause contained a bind placeholder, binding raises SQLite3::RangeException instead of running the query. This issue is fixed in version 2.10.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"sqlite3 provides Ruby bindings for the SQLite3 embedded database. Prior to 2.10.2, sqlite3-ruby casts Ruby string lengths to int before passing SQL through Database#prepare, bound String or Blob values through Statement#bind_param, and String or Blob results from Ruby-defined SQL functions and aggregates through Database#create_function and Database#create_aggregate. On 64-bit platforms, a string of 4 GiB (2^32 bytes) or larger can wrap the length so SQLite processes only a prefix. A truncated SQL string can drop trailing clauses such as a WHERE condition, while a truncated bound value matters only when the application validated the full value before binding it. Exploitation requires the application and server to accept and retain the unusually large attacker-controlled string. If a dropped SQL clause contained a bind placeholder, binding raises SQLite3::RangeException instead of running the query. This issue is fixed in version 2.10.2.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nsqlite3-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:\n\n- the SQL passed to `Database#prepare`, `#execute`, and related methods\n- String and Blob values passed to `Statement#bind_param` and related methods\n- String and Blob values returned from SQL functions and aggregates defined in Ruby (`Database#create_function`, `#create_aggregate`, and related methods)\n\nsqlite3 v2.10.2 raises `RangeError` when any of these strings is longer than `INT_MAX` bytes.\n\n### Severity\n\nThe 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.\n\nA 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.\n\n### Mitigation\n\nUpgrade to sqlite3 v2.10.2 or later.\n\nAs 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.\n\n### Credit\n\nThis issue was responsibly reported by Luke Jahnke from elttam.","format":"markdown","source":"ghsa"}],"published":"2026-11-13T18:47:22.594Z","modified":"2026-11-18T14:17:31.100Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"}],"cwes":["CWE-681"],"affected":[{"ranges":[{"version":"< 2.10.2","status":"affected"}],"vendor":"sparklemotion","product":"sqlite3-ruby","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.10.2"}],"ecosystem":"RubyGems","package":"sqlite3","purl":"pkg:gem/sqlite3","source":"ghsa"}],"references":[{"url":"https://github.com/sparklemotion/sqlite3-ruby/security/advisories/GHSA-4fqr-96q8-xrfx","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/pull/762","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/commit/41059aa3ccc2c0f910d6df4fccfe36b3c3c6c649","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby/releases/tag/v2.10.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sqlite3/GHSA-4fqr-96q8-xrfx.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/sparklemotion/sqlite3-ruby","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-18T13:05:16.351Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-128084","url":"https://www.cve.org/CVERecord?id=CVE-2026-128084","licence":"CVE Terms of Use","modified":"2026-11-18T13:05:55.099Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4fqr-96q8-xrfx","url":"https://github.com/advisories/GHSA-4fqr-96q8-xrfx","licence":"CC-BY-4.0","modified":"2026-11-13T19:15:05.631Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-128084","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-128084","licence":"Public domain","modified":"2026-11-18T14:17:31.100Z"}],"updatedAt":"2026-11-25T22:59:50.772Z","epss":{"score":0.00315,"percentile":0.26326,"date":"2026-12-01T12:00:22.000Z"}}