1 line
4.0 KiB
JSON
1 line
4.0 KiB
JSON
{"schema_version":"1.9.2","id":"GHSA-4fqr-96q8-xrfx","published":"2026-11-13T18:57:58Z","modified":"2026-11-13T19:15:05.631796413Z","aliases":["CVE-2026-128084"],"summary":"sqlite3-ruby: Possible SQL query truncation when a string is 4 GiB or larger","details":"### 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.","affected":[{"package":{"name":"sqlite3","ecosystem":"RubyGems","purl":"pkg:gem/sqlite3"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.10.2"}]}],"versions":["0.0.0","0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.1.0","0.1.1","1.3.10","1.3.11","1.3.12","1.3.13","1.3.3","1.3.3.beta.1","1.3.4","1.3.5","1.3.6","1.3.7","1.3.8","1.3.9","1.4.0","1.4.1","1.4.2","1.4.3","1.4.4","1.5.0","1.5.0.rc1","1.5.0.rc2","1.5.1","1.5.2","1.5.3","1.5.4","1.6.0","1.6.0.rc1","1.6.0.rc2","1.6.1","1.6.2","1.6.3","1.6.4","1.6.5","1.6.5.rc1","1.6.6","1.6.7","1.6.8","1.6.9","1.7.0","1.7.1","1.7.2","1.7.3","2.0.0","2.0.1","2.0.2","2.0.3","2.0.4","2.1.0","2.1.0.rc1","2.1.0.rc2","2.1.0.rc3","2.1.1","2.10.0","2.10.1","2.2.0","2.3.0","2.3.1","2.4.0","2.4.1","2.5.0","2.5.0.rc1","2.6.0","2.7.0","2.7.1","2.7.2","2.7.3","2.7.4","2.8.0","2.8.1","2.9.0","2.9.1","2.9.2","2.9.2.rc2","2.9.3","2.9.4","2.9.5","2.9.6"],"database_specific":{"last_known_affected_version_range":"<= 2.10.1","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-4fqr-96q8-xrfx/GHSA-4fqr-96q8-xrfx.json"}}],"references":[{"type":"WEB","url":"https://github.com/sparklemotion/sqlite3-ruby/security/advisories/GHSA-4fqr-96q8-xrfx"},{"type":"WEB","url":"https://github.com/sparklemotion/sqlite3-ruby/pull/762"},{"type":"WEB","url":"https://github.com/sparklemotion/sqlite3-ruby/commit/41059aa3ccc2c0f910d6df4fccfe36b3c3c6c649"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/sqlite3/GHSA-4fqr-96q8-xrfx.yml"},{"type":"PACKAGE","url":"https://github.com/sparklemotion/sqlite3-ruby"},{"type":"WEB","url":"https://github.com/sparklemotion/sqlite3-ruby/releases/tag/v2.10.2"}],"database_specific":{"cwe_ids":["CWE-681"],"github_reviewed":true,"github_reviewed_at":"2026-11-13T18:57:58Z","nvd_published_at":null,"severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"}]} |