Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: AES-KW through main process Web Crypto API causes SIGABRT #36256

Closed
3 tasks done
panva opened this issue Nov 4, 2022 · 9 comments
Closed
3 tasks done

[Bug]: AES-KW through main process Web Crypto API causes SIGABRT #36256

panva opened this issue Nov 4, 2022 · 9 comments

Comments

@panva
Copy link

panva commented Nov 4, 2022

Preflight Checklist

Electron Version

21.2.2

What operating system are you using?

macOS

Operating System Version

Ventura

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

n/a

Expected Behavior

I would expect the wrapKey call to be rejected instead of SIGABRT on the account of AES-WRAP not being supported in BoringSSL.

Actual Behavior

/Electron.app/Contents/MacOS/Electron[13257]: ../../third_party/electron_node/src/crypto/crypto_aes.cc:569:static Maybe<bool> node::crypto::AESCipherTraits::AdditionalConfig(CryptoJobMode, const FunctionCallbackInfo<Value> &, unsigned int, WebCryptoCipherMode, AESCipherConfig *): Assertion `(params->cipher) != nullptr' failed.
 1: 0x1120e5580 node::FatalException(v8::Isolate*, v8::TryCatch const&) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 2: 0x1120e5374 node::FatalException(v8::Isolate*, v8::TryCatch const&) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 3: 0x1121df1ac node::SetTracingController(v8::TracingController*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 4: 0x1121e0dec node::SetTracingController(v8::TracingController*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 5: 0x10d1be5d0 v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Name>, void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<v8::Boolean> const&)) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 6: 0x10d1be134 v8::internal::Accessors::MakeAccessor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Name>, void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::Name>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<v8::Boolean> const&)) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
 7: 0x147f0cc8c 
 8: 0x147e89da8 
 9: 0x147fb2cdc 
10: 0x147e8c5a4 
11: 0x147e8c5a4 
12: 0x147e8c5a4 
13: 0x147e8c5a4 
14: 0x147ec1db4 
15: 0x147f605b8 
16: 0x147eb241c 
17: 0x147e8a888 
18: 0x10d278838 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
19: 0x10d27917c v8::internal::Execution::TryCallScript(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSFunction>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::FixedArray>, v8::internal::Execution::MessageHandling, v8::internal::MaybeHandle<v8::internal::Object>*, bool) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
20: 0x10d2792f0 v8::internal::Execution::TryCall(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, v8::internal::Execution::MessageHandling, v8::internal::MaybeHandle<v8::internal::Object>*, bool) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
21: 0x10d2a20f0 v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
22: 0x112051d14 node::CallbackScope::~CallbackScope() [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
23: 0x112052160 node::CallbackScope::~CallbackScope() [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
24: 0x112064840 node::EmitAsyncDestroy(node::Environment*, node::async_context) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
25: 0x112211ca4 node::SetTracingController(v8::TracingController*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
26: 0x10c368fd4 uv_random [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
27: 0x10c36c414 uv_async_send [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
28: 0x10c37d568 uv_free_interface_addresses [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
29: 0x10c36c820 uv_run [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
30: 0x10c4bc8ac node::FreeArrayBufferAllocator(node::ArrayBufferAllocator*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
31: 0x10ec099d8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
32: 0x10ec23d50 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
33: 0x10ec5dd5c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
34: 0x10c2fc010  [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
35: 0x10ec5d12c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
36: 0x18b34da34 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation]
37: 0x18b34d9c8 __CFRunLoopDoSource0 [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation]
38: 0x18b34d738 __CFRunLoopDoSources0 [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation]
39: 0x18b34c33c __CFRunLoopRun [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation]
40: 0x18b34b8a4 CFRunLoopRunSpecific [/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation]
41: 0x1949bf3bc RunCurrentEventLoopInMode [/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox]
42: 0x1949bf200 ReceiveNextEventCommon [/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox]
43: 0x1949bef48 _BlockUntilNextEventMatchingListInModeWithFilter [/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox]
44: 0x18e5a4630 _DPSNextEvent [/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit]
45: 0x18e5a37c0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] [/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit]
46: 0x18e597bf0 -[NSApplication run] [/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit]
47: 0x10ec5ece8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
48: 0x10ec5cc84 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
49: 0x10ec24724 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
50: 0x10ebf15f4 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
51: 0x10dfbc4c8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
52: 0x10dfbddcc v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
53: 0x10dfba1f8 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
54: 0x10c6056e0 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
55: 0x10c606578 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
56: 0x10c6063ac v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
57: 0x10c604db0 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
58: 0x10c605268 v8::internal::compiler::BasicBlock::set_loop_header(v8::internal::compiler::BasicBlock*) [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
59: 0x10c37db30 ElectronMain [/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
60: 0x18af43e50 start [/usr/lib/dyld]
/Electron.app/Contents/MacOS/Electron exited with signal SIGABRT

Testcase Gist URL

https://gist.github.com/0a69f62d5d1257956d9556a7451889b5

Additional Information

No response

@panva panva added the bug 🪲 label Nov 4, 2022
@panva
Copy link
Author

panva commented Nov 4, 2022

quick question: how come Bun (also uses BoringSSL) has support of AES Key Wrap and yet the electron main process doesn't support it, while the renderer process does (fiddle gist)...

@codebytere
Copy link
Member

codebytere commented Nov 6, 2022

@panva that'd be because in the renderer process, you have access to WebCrypto APIs provided by Chromium/Blink, whereas in the main process they're backed by Node.js. I can look into what options we might have.

@panva
Copy link
Author

panva commented Nov 6, 2022

I get that but its still boringssl backing both, isnt it?

@codebytere
Copy link
Member

codebytere commented Nov 6, 2022

yeah - and it does look like it's available in BoringSSL here. Lemme dig into it some more.

FWIW bun seems to roll it all themselves: https://github.com/oven-sh/bun/tree/6142715c06d5eb3dbaa07901a6281ae1394483a9/src/bun.js/bindings/webcrypto

nodejs-github-bot pushed a commit to nodejs/node that referenced this issue Nov 7, 2022
Refs: electron/electron#36256
PR-URL: #45321
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
lucshi pushed a commit to lucshi/node that referenced this issue Nov 9, 2022
Refs: electron/electron#36256
PR-URL: nodejs#45321
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
RafaelGSS pushed a commit to nodejs/node that referenced this issue Nov 10, 2022
Refs: electron/electron#36256
PR-URL: #45321
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
danielleadams pushed a commit to nodejs/node that referenced this issue Dec 30, 2022
Refs: electron/electron#36256
PR-URL: #45321
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
danielleadams pushed a commit to nodejs/node that referenced this issue Dec 30, 2022
Refs: electron/electron#36256
PR-URL: #45321
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
danielleadams pushed a commit to nodejs/node that referenced this issue Jan 3, 2023
Refs: electron/electron#36256
PR-URL: #45321
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
danielleadams pushed a commit to nodejs/node that referenced this issue Jan 4, 2023
Refs: electron/electron#36256
PR-URL: #45321
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Feb 8, 2023
@panva
Copy link
Author

panva commented Feb 8, 2023

@codebytere aside of the crash that will get fixed when the mentioned node PR makes it to a release electron includes, did you have a chance to see if AES-KW is not available intentionally or if it maybe could be enabled?

@codebytere codebytere removed the stale label Feb 8, 2023
@codebytere
Copy link
Member

@panva the crash has since been resolved, and i haven't had time yet but i still plan to look into potentially enabling it!

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label May 10, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2023

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants