Files
node/lib
Felipe Forbeck 6bf7fd7f4e crypto: fix cross-realm check of ArrayBuffer
This patch modifies the `isNonSharedArrayBuffer` function in the WebIDL
implementation for the SubtleCrypto API to properly handle `ArrayBuffer`
instances created in different JavaScript realms.

Before this fix, when a `TypedArray.buffer` from a different realm
(e.g., from a VM context or worker thread) was passed to
`SubtleCrypto.digest()`, it would fail with:

> TypeError: Failed to execute 'digest' on 'SubtleCrypto': 2nd argument
> is not instance of ArrayBuffer, Buffer, TypedArray, or DataView."

The fix use the `isArrayBuffer` function from `internal/util/types` to
detect cross-realm `ArrayBuffer` instances when the prototype chain
check fails.

PR-URL: https://github.com/nodejs/node/pull/57828
Refs: https://github.com/storacha/w3up/issues/1591
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-04-22 15:01:21 +02:00
..
2024-09-24 19:48:15 +00:00
2024-10-09 06:42:16 +00:00
2025-03-04 08:33:21 -08:00
2024-12-15 14:19:27 +00:00
2024-10-09 06:42:16 +00:00
2024-10-09 06:42:16 +00:00
2025-01-04 18:30:04 +00:00
2025-02-01 02:13:57 +00:00
2025-03-04 11:14:34 +00:00