lib: reject SharedArrayBuffer in web APIs per spec#62632
lib: reject SharedArrayBuffer in web APIs per spec#62632thisalihassan wants to merge 2 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
|
The webstream changes are not semver-major IMO, as passing a shared view is currently a broken operation – this change simply validates the buffer up-front, rather than throwing a difficult-to-catch exception when data starts flowing. As such, this could be split down into two PRs, one semver-patch for the webstream changes, one semver-major for blob. The compression stream change here is unnecessary because the underlying adapter doesn't accept shared array buffers, so the validation change here is a no-op. (ref #62163) |
|
@Renegade334 thanks for the detailed feedback.
I will check how the adapter handles it with your #62163 in mind. |
Signed-off-by: Ali Hassan <ali-hassan27@outlook.com>
Signed-off-by: Ali Hassan <ali-hassan27@outlook.com>
2f0223b to
cec023c
Compare
|
@panva @Renegade334 can we drop semver-major label and add semver-patch instead? As I have reverted the blob changes |
The WebIDL spec requires BufferSource/ArrayBufferView (without AllowShared) to reject SharedArrayBuffer and views backed by one.
Node.js web APIs handle this inconsistently, moved the SAB BufferSource/ArrayBufferView validators from internal/crypto/webidl into the shared internal/webidl module and fixes the non-compliant call sites:
Blob constructor changes (semver-major) will be submitted as a separate PR.
Quick Research:
Deno already rejects these cases while Bun does not (as of Bun 1.3).
Fixes: #59688