Repository navigation
Update dependency sqlite3 to v2.10.2 [SECURITY] - #1546
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.9.6→2.10.2sqlite3-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) tointbefore 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 firstlength mod 2^32bytes. An attacker who controls the length of a SQL string could truncate the query, for example dropping a trailingWHEREclause. The affected paths are:Database#prepare,#execute, and related methodsStatement#bind_paramand related methodsDatabase#create_function,#create_aggregate, and related methods)sqlite3 v2.10.2 raises
RangeErrorwhen any of these strings is longer thanINT_MAXbytes.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::RangeExceptioninstead 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:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
sparklemotion/sqlite3-ruby (sqlite3)
v2.10.2Compare Source
Security / Stability
RangeErrorwhen a SQL string, a bound String or Blob value, or a String or Blob returned from a custom function or aggregate is longer thanINT_MAXbytes. 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 @flavorjonesfinalizereturns 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 @flavorjonesDatabase#collationsis cleared, modified or frozen. GC could free a comparator that SQLite still called. When that hash is frozen,Database#collationstill raisesFrozenError, but the new comparator stays registered and in use. #764 @flavorjonestraceblock,busy_handlerblock or authorizer raises, or when an interrupt such asThread#raisearrives 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 @flavorjonesthrow. The throw now unwinds to itscatch. #764 @flavorjonesChanged
traceblock 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, anINSERTwhosetraceblock raises now inserts its row.Database#execute_batch2now raises the exception from a custom function, instead ofSQLite3::SQLException"Ruby Exception occurred".Statement#reset!orDatabase#closeis discarded.Thread.current[:__sqlite3_callback_frames__]. A query raisesFrozenErroron aThreadthat was frozen before its first query. #764 @flavorjonesSQLite3::MemoryExceptioninstead of aborting the process. #764 @flavorjonesImproved
Statement#stepno longer allocates and discards an array when the statement has no more rows. This saves one object per statement execution. #758 @thomasklemmObjectSpace.dumpand heap profilers now reportSQLite3::DatabaseandSQLite3::Statementobjects under their own type names, instead ofSQLite3::Backup. #764 @flavorjonesDocumentation
Statement#execute,#execute!,#bind_paramand#bind_paramsstay bound across executions, and thatStatement#clear_bindings!clears them. #751 @flavorjonesv2.10.1Compare Source
Dependencies
x86-linux-gnuandx86-linux-muslgems. #756 @flavorjonesImproved
Database#define_aggregatorno 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 @jhawthornv2.10.0Compare Source
Dependencies
Vendored sqlite is updated to v3.54.0 (from v3.53.2). #750 @flavorjones
Notable changes in this version include:
ALTER TABLEnow raises an error when adding, renaming, or dropping a column namedROWID,_ROWID_, orOID.DEFAULTclauses ofCREATE TABLEstatements.Added
ResultSet#eachand#each_hashreturn anEnumeratorwhen called without a block. Previously they raisedLocalJumpError. #656 @kchDatabase#serialize, which returns a database as a binary string, andDatabase#deserialize, which replaces a database with the contents of such a string. These wrapsqlite3_serialize()andsqlite3_deserialize(). Both methods are defined only when SQLite was compiled withoutSQLITE_OMIT_DESERIALIZE, andDatabase#deserializealso 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 theDatabase#deserializedocumentation. #685 @MaaarcocrFixed
Database#statement_timeout=interrupting statements almost immediately instead of after the timeout elapsed, including re-executed prepared statements and calls toDatabase#execute_batch2. #737 @palkan @flavorjonesImproved
Statement#typesallocates fewer strings. Each declared type is downcased and interned in C, instead of allocating two strings per column. #743 @jhawthornChanged
ResultSet#eachand#each_hashreturn the result set when called with a block. As a consequence,Database#executeand#execute2called with a block return the closedResultSetinstead ofnil. #656 @kchStatement#columnsandStatement#typesreturn frozen arrays, and the strings inStatement#typesare frozen. Code that mutates them now raisesFrozenError. #743 @jhawthornStatement#column_decltypeandStatement#typesreturn UTF-8 strings. Previously they returned ASCII-8BIT strings. #743 @jhawthornConfiguration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.