-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Decrypting a zero-length array with SubtleCrypto triggers Assertion failures #38883
Labels
confirmed-bug
Issues with confirmed bugs.
crypto
Issues and PRs related to the crypto subsystem.
webcrypto
Comments
cc @nodejs/crypto |
panva
added
confirmed-bug
Issues with confirmed bugs.
crypto
Issues and PRs related to the crypto subsystem.
labels
Jun 1, 2021
XadillaX
added a commit
to XadillaX/node
that referenced
this issue
Jun 3, 2021
XadillaX
added a commit
to XadillaX/node
that referenced
this issue
Jun 3, 2021
XadillaX
added a commit
to XadillaX/node
that referenced
this issue
Jun 3, 2021
This was
linked to
pull requests
Jun 3, 2021
danielleadams
pushed a commit
that referenced
this issue
Jun 21, 2021
Fixes: #38883 PR-URL: #38914 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
XadillaX
added a commit
to XadillaX/node
that referenced
this issue
Jun 22, 2021
XadillaX
added a commit
to XadillaX/node
that referenced
this issue
Jun 24, 2021
XadillaX
added a commit
to XadillaX/node
that referenced
this issue
Jun 25, 2021
targos
pushed a commit
that referenced
this issue
Jul 11, 2021
Fixes: #38883 PR-URL: #38913 Refs: #38883 Reviewed-By: Tobias Nießen <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
confirmed-bug
Issues with confirmed bugs.
crypto
Issues and PRs related to the crypto subsystem.
webcrypto
Darwin shinji 20.6.0 Darwin Kernel Version 20.6.0: Mon May 10 03:15:35 PDT 2021; root:xnu-7195.140.13.0.1~20/RELEASE_X86_64 x86_64 i386 MacBookPro16,2 Darwin
What steps will reproduce the bug?
Attempting to decrypt a zero-length array crashes node completely. There are two ways to trigger this.
The first encrypts a zero length array and then attempts to decrypt that same data:
The second simply decrypts a zero length data array:
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior?
The
decrypt
call should produce a zero-length array in the first case, and fail in the second (chrome rejects withThe provided data is too small
).What do you see instead?
Node crashes. The two snippets trigger different errors.
First:
Second:
Additional information
These inputs are far from normal, but I figure node should never crash.
The project I work on has property tests involving webcrypto. We've been using
node-webcrypto-ossl
to run these tests for months; we thought it might be nice to switch to the new built-in webcrypto instead. Our property tests are designed to throw all sorts of invalid values at our own code - but it turns out they throw invalid values at the webcrypto API as well.The text was updated successfully, but these errors were encountered: