ladybird/Libraries/LibWeb/Crypto
sideshowbarker 9ffd3e48c3 LibWeb: Don’t crash on a detached publicExponent in generateKey
Problem: Crash when generating an RSA key — or serializing one —
whose publicExponent is a typed array whose backing ArrayBuffer has
been detached; for example, by calling transfer() on it.

Cause: Two places with big_integer_from_api_big_integer() reading the
bytes of the backing ArrayBuffer directly. But reading the bytes of a
detached buffer aborts.

Fix: Read the bytes with WebIDL get_buffer_source_copy() — which yields
an empty copy for a detached, or OOB resizable, buffer. The empty array
is already mapped to zero — so generation rejects the zero exponent with
an error, rather than crashing.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/9991
2026-06-21 14:04:01 +02:00
..
Crypto.cpp LibWeb/Bindings: Generate buffer typedefs as variants 2026-05-30 11:22:08 +02:00
Crypto.h LibWeb/Bindings: Generate buffer typedefs as variants 2026-05-30 11:22:08 +02:00
Crypto.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00
CryptoAlgorithms.cpp LibWeb: Don’t crash on a detached publicExponent in generateKey 2026-06-21 14:04:01 +02:00
CryptoAlgorithms.h LibWeb/Bindings: Generate buffer typedefs as variants 2026-05-30 11:22:08 +02:00
CryptoBindings.cpp LibWeb/Crypto: Move WebCrypto dictionaries into Crypto namespace 2026-04-23 22:12:13 +02:00
CryptoBindings.h LibWeb/Crypto: Move WebCrypto dictionaries into Crypto namespace 2026-04-23 22:12:13 +02:00
CryptoKey.cpp LibWeb: Don’t crash on a detached publicExponent in generateKey 2026-06-21 14:04:01 +02:00
CryptoKey.h LibWeb/Crypto: Fix CryptoKey usages being lost across in serialization 2026-05-27 02:44:46 +01:00
CryptoKey.idl LibWeb: Update the Key Usage enum to adapt for PostQuantum Algorithms 2025-11-27 21:50:06 +01:00
KeyAlgorithms.cpp LibJS+LibWeb: Allow instantiating DataBlock with an external buffer 2026-05-10 16:41:42 +02:00
KeyAlgorithms.h LibCrypto: Implement KMAC authentication support 2026-03-19 10:46:49 +01:00
SubtleCrypto.cpp LibJS: Isolate ArrayBuffer backing stores 2026-06-10 14:50:10 +02:00
SubtleCrypto.h LibWeb/Bindings: Generate buffer typedefs as variants 2026-05-30 11:22:08 +02:00
SubtleCrypto.idl LibWeb+LibIDL: Remove support for #import directives during parsing 2026-04-24 20:08:29 +02:00