CVE-2026-128084: sqlite3-ruby Possible SQL Query Truncation When Vulnerability

MODERATE
Advisory Identifier: GHSA-4fqr-96q8-xrfx
CVSS 4.8
CWE-681
Published
Advisory Summary

CVE-2026-128084 is a MODERATE (CVSS 4.8) possible sql query truncation when vulnerability (CWE-681: Incorrect Conversion between Numeric Types) affecting sqlite3-ruby libraries in the RubyGems ecosystem. The issue involves possible sql query truncation when a string is 4 gib or larger. Remediation is available by upgrading affected packages to version 2.10.2.

CVE-2026-128084 at a Glance

CVE Identifier CVE-2026-128084
GHSA Identifier GHSA-4fqr-96q8-xrfx
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-681: Incorrect Conversion between Numeric Types
Affected Product sqlite3-ruby
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 4.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-128084

To remediate this vulnerability, upgrade all affected sqlite3-ruby dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sqlite3 fixed: 2.10.2
Upgrade sqlite3 to 2.10.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for sqlite3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-128084, inspect your project dependencies for sqlite3-ruby:

inspect dependencies for sqlite3

Analyze the terminal output to locate any version of sqlite3-ruby in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-681: Incorrect Conversion between Numeric Types, where when converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. if the resulting values are used in a sensitive context, then dangerous behaviors may occur. In sqlite3-ruby, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-128084 Affected sqlite3-ruby Versions

1 component(s)
Fixed Versions:
2.10.2
Product / Package Ecosystem Affected Versions Fixed Version
sqlite3
RubyGems
< 2.10.2
2.10.2

References

Frequently Asked Questions

What is CVE-2026-128084?
CVE-2026-128084 is a security vulnerability in sqlite3-ruby involving Possible SQL query truncation when a string is 4 GiB or larger under CWE-681: Incorrect Conversion between Numeric Types.
Which sqlite3-ruby versions are affected?
Affected versions include releases prior to 2.10.2 across affected packages: sqlite3.
What version fixes CVE-2026-128084?
Upgrading to 2.10.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sqlite3 affected?
Yes, sqlite3 is affected in releases prior to 2.10.2. Upgrade your dependency to 2.10.2 or later.
What is the CVSS score of CVE-2026-128084?
CVE-2026-128084 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-128084?
CVE-2026-128084 is classified under CWE-681: Incorrect Conversion between Numeric Types (When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.).
How can I check RubyGems dependencies for CVE-2026-128084?
Run the dependency tree command: 'inspect dependencies for sqlite3'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4fqr-96q8-xrfx",
  "modified" : "2026-11-13T18:57:58Z",
  "published" : "2026-11-13T18:57:58Z",
  "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "sqlite3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.10.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.10.1"
    }
  } ],
  "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" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-13T18:57:58Z",
    "nvd_published_at" : null
  }
}