Skip to content

fix(ext/napi): check napi_create_dataview bounds for overflow - #36962

Merged
bartlomieju merged 1 commit into
mainfrom
fix/napi-dataview-overflow
Oct 6, 2026
Merged

bartlomieju merged 1 commit into
mainfrom
fix/napi-dataview-overflow

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

napi_create_dataview checked byte_length + byte_offset against the buffer
size without guarding the addition. Addon-controlled values could overflow it:
debug builds panicked across the extern "C" boundary, and release builds
wrapped around, so the bounds check passed and V8 was handed an out-of-range
DataView. The sum is now computed with checked_add, and an overflow is
treated as out of range, throwing the same RangeError as any other bad offset.

Follow-up to #36942.

@bartlomieju
bartlomieju enabled auto-merge (squash) October 6, 2026 09:05
@bartlomieju
bartlomieju merged commit ead2af9 into main Oct 6, 2026
267 of 269 checks passed
@bartlomieju
bartlomieju deleted the fix/napi-dataview-overflow branch October 6, 2026 09:06
nightness pushed a commit to Brainwires/deno that referenced this pull request Oct 13, 2026
bartlomieju added a commit that referenced this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant