Files
node/lib
Felipe Forbeck 78f4ffee5d 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-05-19 12:14:01 +02:00
..
…
…
…
…
2024-10-04 10:20:24 +02:00
2024-11-27 11:03:39 -05:00
2024-11-27 11:03:39 -05:00
…
2025-01-05 13:05:31 -05:00
…
2024-07-16 12:01:14 +02:00
2024-11-27 11:03:39 -05:00
2024-11-27 11:03:39 -05:00
…
2025-02-03 20:09:53 +01:00
2025-01-05 13:05:25 -05:00
2025-04-17 10:51:20 -03:00
…