Skip to content

Update dependency sqlite3 to v2.10.2 [SECURITY] - #1546

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/rubygems-sqlite3-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/rubygems-sqlite3-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
sqlite3 (changelog) 2.9.6 → 2.10.2 age confidence

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

CVE-2026-128084 / GHSA-4fqr-96q8-xrfx

More information

Details

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.

Severity

  • CVSS Score: 4.8 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

sparklemotion/sqlite3-ruby (sqlite3)

v2.10.2

Compare Source

Security / Stability
  • Raise RangeError when a SQL string, a bound String or Blob value, or a String or Blob returned from a custom function or aggregate is longer than INT_MAX bytes. Previously the length was truncated to 32 bits, so SQLite could read only part of the string and drop trailing clauses from a query. See GHSA-4fqr-96q8-xrfx for more information. #​762 @​flavorjones
  • Fix a crash when a custom aggregate's finalize returns a value that can't be converted to a SQLite result. The exception is now raised from the query and the connection remains usable. #​762 @​flavorjones
  • Fix a use-after-free when the hash returned by Database#collations is cleared, modified or frozen. GC could free a comparator that SQLite still called. When that hash is frozen, Database#collation still raises FrozenError, but the new comparator stays registered and in use. #​764 @​flavorjones
  • Fix a deadlock when a collation comparator, trace block, busy_handler block or authorizer raises, or when an interrupt such as Thread#raise arrives while an aggregate's handler is being created. Another thread that used the connection blocked forever. The exception is now raised from the query and the connection remains usable. See "Changed" below for what SQLite does before the exception is raised. #​764 @​flavorjones
  • Fix a crash when a custom function or aggregate uses throw. The throw now unwinds to its catch. #​764 @​flavorjones
Changed
  • When a callback raises or throws, SQLite now finishes its current call before the exception is raised, instead of being unwound in the middle of it. #​764 @​flavorjones
    • When a trace block raises, SQLite runs the statement up to its first row, or to completion, before the exception is raised. Previously the statement stopped where the block raised. For example, an INSERT whose trace block raises now inserts its row.
    • The other callbacks in that SQLite call skip their Ruby code: collation comparators return 0, functions and aggregates report an error to SQLite, the busy handler stops retrying and the authorizer denies.
    • Database#execute_batch2 now raises the exception from a custom function, instead of SQLite3::SQLException "Ruby Exception occurred".
    • An exception from a callback that SQLite runs during Statement#reset! or Database#close is discarded.
  • The extension keeps per-fiber state in Thread.current[:__sqlite3_callback_frames__]. A query raises FrozenError on a Thread that was frozen before its first query. #​764 @​flavorjones
  • When SQLite can't allocate an aggregate's context, the query raises SQLite3::MemoryException instead of aborting the process. #​764 @​flavorjones
Improved
  • Statement#step no longer allocates and discards an array when the statement has no more rows. This saves one object per statement execution. #​758 @​thomasklemm
  • ObjectSpace.dump and heap profilers now report SQLite3::Database and SQLite3::Statement objects under their own type names, instead of SQLite3::Backup. #​764 @​flavorjones
Documentation
  • Document that parameters bound by Statement#execute, #execute!, #bind_param and #bind_params stay bound across executions, and that Statement#clear_bindings! clears them. #​751 @​flavorjones

v2.10.1

Compare Source

Dependencies
  • Vendored sqlite is updated to v3.54.1 (from v3.54.0). This release contains a fix for a possible heap buffer overflow on 32-bit builds, including the precompiled x86-linux-gnu and x86-linux-musl gems. #​756 @​flavorjones
Improved
  • Database#define_aggregator no longer creates an anonymous class for each aggregate function it defines. Each invocation of the function still runs on a clone of the template object. #​752 @​jhawthorn

v2.10.0

Compare Source

Dependencies
  • Vendored sqlite is updated to v3.54.0 (from v3.53.2). #​750 @​flavorjones

    Notable changes in this version include:

    • ALTER TABLE now raises an error when adding, renaming, or dropping a column named ROWID, _ROWID_, or OID.
    • The authorizer callback is now invoked for SQL functions in the DEFAULT clauses of CREATE TABLE statements.
    • SQLite no longer supports Windows XP or earlier. On Windows, the precompiled gem and any installation that compiles the vendored sqlite now require Windows Vista or later.
Added
  • ResultSet#each and #each_hash return an Enumerator when called without a block. Previously they raised LocalJumpError. #​656 @​kch
  • Introduce Database#serialize, which returns a database as a binary string, and Database#deserialize, which replaces a database with the contents of such a string. These wrap sqlite3_serialize() and sqlite3_deserialize(). Both methods are defined only when SQLite was compiled without SQLITE_OMIT_DESERIALIZE, and Database#deserialize also requires that the loaded SQLite is v3.54.0 or later. An image of a database in WAL mode cannot be queried after deserializing; see the Database#deserialize documentation. #​685 @​Maaarcocr
Fixed
  • Fix Database#statement_timeout= interrupting statements almost immediately instead of after the timeout elapsed, including re-executed prepared statements and calls to Database#execute_batch2. #​737 @​palkan @​flavorjones
Improved
  • On CRuby, Statement#types allocates fewer strings. Each declared type is downcased and interned in C, instead of allocating two strings per column. #​743 @​jhawthorn
Changed
  • ResultSet#each and #each_hash return the result set when called with a block. As a consequence, Database#execute and #execute2 called with a block return the closed ResultSet instead of nil. #​656 @​kch
  • Statement#columns and Statement#types return frozen arrays, and the strings in Statement#types are frozen. Code that mutates them now raises FrozenError. #​743 @​jhawthorn
  • Statement#column_decltype and Statement#types return UTF-8 strings. Previously they returned ASCII-8BIT strings. #​743 @​jhawthorn

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the security label Nov 14, 2026
@mitlib
mitlib temporarily deployed to thesis-submit-pr-1546 November 14, 2026 04:48 Inactive
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.298%. remained the same — renovate/rubygems-sqlite3-vulnerability into main

This branch was previously deployed

1 inactive deployment
thesis-submit-pr-1546 — 89e859ef Deployed Nov 14, 2026 by mitlib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants