The sqlite3-ruby library improperly casts Ruby string lengths from long to int before passing them to SQLite, causing string lengths of 4 GiB or larger to wrap on 64-bit platforms. This results in SQL query truncation where only the first length mod 2^32 bytes are processed. An attacker controlling the SQL string length could truncate queries, potentially dropping trailing clauses such as WHERE. The issue affects SQL strings passed to Database#prepare, #execute, bound parameters, and Ruby-defined SQL functions and aggregates. The vulnerability is fixed in sqlite3-ruby version 2.10.2, which raises a RangeError for strings longer than INT_MAX bytes.