Skip to content

ffi: validate fast i32 argument ranges#64691

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:ffi-i32-bypass-validation
Open

ffi: validate fast i32 argument ranges#64691
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:ffi-i32-bypass-validation

Conversation

@trivikr

@trivikr trivikr commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fixes: #64690

V8’s Fast API converts signed integer arguments to int32 by
truncation. Fast FFI signatures using i32 or int32 did not enable the
JavaScript integer-validation wrapper, so optimized calls could accept
out-of-range or non-integer values that the generic FFI path rejects.

Add both signed 32-bit type names to the Fast API validation metadata and
native validation-selection check.


Assisted-by: openai:gpt-5.6-sol

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/ffi

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run. labels Jul 23, 2026
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 23, 2026
Add i32 and int32 to Fast API integer validation so optimized calls
reject invalid values instead of allowing V8 to truncate them.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.6-sol
@trivikr
trivikr force-pushed the ffi-i32-bypass-validation branch from 5cfc0ae to a5ff09c Compare July 23, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. ffi Issues and PRs related to experimental Foreign Function Interface support. needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ffi: Fast FFI bypasses i32 range validation after V8 optimization

2 participants