Repository navigation
Conversation
Collaborator
|
Review requested:
|
trivikr
force-pushed
the
sqlite-error-msg-v8-string-limit
branch
2 times, most recently
from
October 5, 2026 03:25
c6c38b5 to
a9632cc
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 15:18
a9632cc to
b5dfc66
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66521 +/- ##
==========================================
- Coverage 92.74% 90.40% -2.34%
==========================================
Files 422 791 +369
Lines 193170 275995 +82825
Branches 29783 52976 +23193
==========================================
+ Hits 179160 249520 +70360
- Misses 13682 16873 +3191
- Partials 328 9602 +9274
🚀 New features to boost your workflow:
|
avivkeller
approved these changes
Oct 5, 2026
jasnell
approved these changes
Oct 5, 2026
Contributor
Failed to resume CIFull Auto Start CI output |
Member
Author
|
I'm not sure why The error is in ...
ok 1401 parallel/test-sqlite-statement
---
duration_ms: 34102.26500
...
ok 1402 sea/test-single-executable-application-assets # skip Cannot find signtool: Error: - process terminated with status 1, expected 0
---
duration_ms: 2427.06500
...
failed 1 out of 10
not ok 1403 report/test-report-process-timeout-worker
---
duration_ms: 6928.28600
severity: fail
exitcode: 1
stack: |-
<anonymous_script>:450
"add
SyntaxError: Unterminated string in JSON at position 12288 (line 450 column 11)
at JSON.parse (<anonymous>)
at Object.validate (C:\workspace\node-test-binary-windows-js-suites\node\test\common\report.js:32:24)
at Object.<anonymous> (C:\workspace\node-test-binary-windows-js-suites\node\test\report\test-report-process-timeout-worker.js:36:10)
at Module._compile (node:internal/modules/cjs/loader:1968:14)
at Object..js (node:internal/modules/cjs/loader:2108:10)
at Module.load (node:internal/modules/cjs/loader:1690:32)
at Module._load (node:internal/modules/cjs/loader:1480:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:261:19)
at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:33:47
Node.js v27.0.0-pre
... |
Collaborator
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