Vulnerability DatabaseCVE-2026-128084

CVE-2026-128084: 
Ruby vulnerability analysis and mitigation

Overview

CVE-2026-128084 is a SQL query truncation vulnerability in the sqlite3-ruby gem (Ruby bindings for SQLite3) caused by an incorrect numeric type conversion. The C extension casts Ruby string lengths from long (64-bit) to int (32-bit) before passing SQL strings and bound values to SQLite, causing integer wraparound on 64-bit platforms for strings ≥ 4 GiB. This can result in SQLite processing only a prefix of the string, potentially dropping trailing SQL clauses such as WHERE conditions. All versions prior to 2.10.2 of the sqlite3 RubyGem (sparklemotion/sqlite3-ruby) are affected. The vulnerability was discovered by Luke Jahnke from elttam, disclosed on October 26, 2026, and carries a CVSS v3.1 base score of 4.8 (Medium) (GitHub Advisory).

Technical details

The root cause is CWE-681 (Incorrect Conversion between Numeric Types): the C extension used explicit (int)RSTRING_LEN(...) casts in statement.c (for Database#prepare, Statement#bind_param) and database.c (for custom SQL functions/aggregates via Database#create_function and Database#create_aggregate). On 64-bit platforms, a string ≥ 4 GiB (2^32 bytes) causes the length to wrap modulo 2^32, so SQLite receives a truncated length and reads only a prefix of the string. For SQL strings, this can silently drop trailing clauses (e.g., a WHERE condition); for bound values, exploitation is limited to cases where the application validated the full value before binding. The fix replaces all (int)RSTRING_LEN(...) casts with RSTRING_LENINT(...), which raises a RangeError instead of silently truncating (GitHub PR #762, Commit 41059aa).

Impact

The primary risk is authentication or access control bypass: an attacker who can inject a ≥ 4 GiB string into a SQL query could cause trailing WHERE clauses to be silently dropped, potentially returning all rows from a table or bypassing row-level filtering. This results in low confidentiality impact (unauthorized data read) and low integrity impact (unintended query behavior), with no direct availability impact. Exploitation is constrained by the requirement that the application and server must accept, retain, and pass a string of at least 4 GiB to the sqlite3-ruby layer, which most production deployments prevent via request body size limits (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code or in-the-wild exploitation has been reported as of the disclosure date. The NVD SSVC assessment classifies exploitation as "none" and the technical impact as "partial". The EPSS score is approximately 0.314%, reflecting a low probability of near-term exploitation. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation is further constrained by the high attack complexity: the attacker must control a string of at least 4 GiB that reaches the sqlite3-ruby layer without being rejected by upstream size limits (GitHub Advisory, Feedly).

Exploitation steps

  1. Identify a vulnerable target: Find a Ruby application using the sqlite3 gem version ≤ 2.10.1 on a 64-bit platform that accepts large, attacker-controlled input and passes it (directly or indirectly) into a SQL string or bound parameter without enforcing a size limit below 4 GiB.
  2. Craft an oversized payload: Construct a string of exactly 2^32 bytes (4 GiB) or larger. The content before the 4 GiB boundary should be valid SQL or a valid bound value; the critical SQL clause (e.g., WHERE user_id = 1) must be placed after the 4 GiB mark so it gets truncated.
  3. Submit the payload: Send the oversized string to the application endpoint that inlines attacker input into a SQL query (e.g., a search field, file upload content, or API parameter that is concatenated into SQL passed to Database#prepare or #execute).
  4. Trigger truncation: The C extension casts the string length to int, wrapping it to a small value. SQLite processes only the prefix, dropping the trailing WHERE clause or other SQL conditions.
  5. Observe the effect: The query executes without the intended filtering clause, potentially returning all rows, bypassing authentication checks, or exposing data that should have been restricted (GitHub Advisory, GitHub PR #762).

Indicators of compromise

  • Logs: Application or web server logs showing unusually large request bodies (approaching or exceeding several gigabytes) submitted to endpoints that interact with SQLite databases; SQLite3::RangeError exceptions in application logs (post-patch, indicating attempted exploitation against a patched system).
  • Application Behavior: Queries returning unexpectedly large result sets or bypassing expected row-level filters; authentication endpoints returning success without proper credential validation.
  • Network: Anomalously large HTTP request bodies (≥ 4 GiB) in network traffic captures targeting Ruby application endpoints.
  • Process: Elevated memory usage on the Ruby application server consistent with holding multiple copies of a multi-gigabyte string in memory (GitHub Advisory).

Mitigation and workarounds

Upgrade the sqlite3 RubyGem to version 2.10.2 or later, which replaces unsafe (int)RSTRING_LEN(...) casts with RSTRING_LENINT(...) to raise a RangeError for strings exceeding INT_MAX bytes. As a workaround for applications that cannot immediately upgrade, explicitly reject SQL strings and bound values of 4 GiB or larger before passing them to sqlite3-ruby, or enforce request body size limits well below 4 GiB at the web server or application layer. Most production deployments (e.g., those using Rack, Nginx, or similar middleware with default body size limits) are already protected by upstream size restrictions (GitHub Advisory, Release v2.10.2).

Community reactions

The vulnerability was responsibly disclosed by Luke Jahnke from security research firm elttam and coordinated with the sqlite3-ruby maintainers before public release. The maintainers (sparklemotion) assessed the severity as moderate (CVSS 4.8), noting that real-world exploitation is constrained by the impracticality of passing 4 GiB strings through typical web infrastructure. No significant broader media coverage or notable community controversy has been observed beyond standard advisory distribution channels (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Ubuntu

Unknown

bionic (esm-apps)

ruby-sqlite3

Unknown

devel

ruby-sqlite3

Unknown

focal (esm-apps)

ruby-sqlite3

Unknown

jammy

ruby-sqlite3

Unknown

jammy (esm-apps)

ruby-sqlite3

Unknown

noble

ruby-sqlite3

Unknown

noble (esm-apps)

ruby-sqlite3

Unknown

resolute

ruby-sqlite3

Unknown

RHEL / CentOS

Unknown

Source: This report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-4859-2mvh-r787HIGH7.1
  • Ruby logoRuby
  • phlex
NoYesNov 23, 2026
GHSA-6gjg-cqh9-p2xmMEDIUM5.9
  • Ruby logoRuby
  • phlex
NoYesNov 23, 2026
GHSA-jjpx-qcfc-pqwpMEDIUM5.9
  • Ruby logoRuby
  • phlex
NoYesNov 23, 2026
GHSA-fxxw-9rf3-3f2wMEDIUM5.9
  • Ruby logoRuby
  • phlex
NoYesNov 23, 2026
GHSA-wcp8-qw9q-vjppMEDIUM4.9
  • Ruby logoRuby
  • doorkeeper-openid_connect
NoYesNov 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management