Conversation
Collaborator
|
Review requested:
|
trivikr
force-pushed
the
sqlite-error-msg-v8-string-limit
branch
from
October 5, 2026 03:18
bc4915c to
c6c38b5
Compare
Several conversions from SQLite text to V8 strings passed a length of -1 to String::NewFromUtf8(). With that length, V8 skips its length check and aborts the process when the UTF-8 text exceeds String::kMaxLength. SQLite error messages embed the offending identifier or token, so CreateSQLiteErrorImpl() could hit this. NullableSQLiteStringToValue(), used for setAuthorizer() callback arguments and statement.columns() metadata, had the same problem, and the authorizer also called ToLocalChecked() on each argument. Convert error messages with Utf8StringMaybeOneByte(), and check the length up front in NullableSQLiteStringToValue(), so oversized strings throw ERR_STRING_TOO_LONG as column values already do. In the authorizer, deny the action and let the pending error reach the caller. Signed-off-by: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Assisted-by: claude:opus-5.5
trivikr
force-pushed
the
sqlite-error-msg-v8-string-limit
branch
from
October 5, 2026 03:25
c6c38b5 to
a9632cc
Compare
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.
Fixes: #66520
Fixes: #66522
Several conversions from SQLite text to V8 strings passed a length of -1 to
String::NewFromUtf8(). With that length, V8 skips its length check and aborts the process when the UTF-8 text exceedsString::kMaxLength.SQLite error messages embed the offending identifier or token, so
CreateSQLiteErrorImpl()could hit this.NullableSQLiteStringToValue(), used forsetAuthorizer()callback arguments andstatement.columns()metadata, had the same problem, and the authorizer also calledToLocalChecked()on each argument.Convert error messages with
Utf8StringMaybeOneByte(), and check the length up front inNullableSQLiteStringToValue(), so oversized strings throwERR_STRING_TOO_LONGas column values already do. In the authorizer, deny the action and let the pending error reach the caller.Assisted-by: claude:opus-5.5