crypto: disable ciphers not supported by EVP#43532
Open
AdamMajer wants to merge 1 commit intonodejs:mainfrom
Open
crypto: disable ciphers not supported by EVP#43532AdamMajer wants to merge 1 commit intonodejs:mainfrom
AdamMajer wants to merge 1 commit intonodejs:mainfrom
Conversation
OpenSSL lists certain ciphers as not conforming with the standard
EVP AEAD interface and these ciphers should be avoided,
aes-128-cbc-hmac-sha1
aes-128-cbc-hmac-sha256
aes-256-cbc-hmac-sha1
aes-256-cbc-hmac-sha256
While experimenting with these, the cipher text produced by Node
for `aes-128-cbc-hmac-sha1` does not differ from cipher text
produced by `aes-128-cbc` meaning that the HMAC is not automatically
taken into account. Since there is no facility to set the HMAC key
in Node, it's best to have these disabled when using crypto.Cipher
as all usage is wrong by definition.
Fixes: nodejs#43040
Collaborator
|
Review requested:
|
bnoordhuis
reviewed
Jun 22, 2022
| } | ||
|
|
||
| function createCipherBase(cipher, credential, options, decipher, iv) { | ||
| switch (cipher.toLowerCase()) { |
Member
There was a problem hiding this comment.
There's a toLowerCase() function in lib/tls.js. It'd be better to move that to some shared file and use that because the prototype method is locale sensitive and vulnerable to prototype pollution.
Member
|
@AdamMajer do you plan on updating this PR? |
Contributor
Author
|
On 8/3/23 22:20, Ben Noordhuis wrote:
@AdamMajer <https://github.com/AdamMajer> do you plan on updating this PR?
Will do. I completely forgot about this!
|
|
Hey, any updates on this? It seems rather important to avoid misuse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenSSL lists certain ciphers as not conforming with the standard
EVP AEAD interface and these ciphers should be avoided,
While experimenting with these, the cipher text produced by Node
for
aes-128-cbc-hmac-sha1does not differ from cipher textproduced by
aes-128-cbcmeaning that the HMAC is not automaticallytaken into account. Since there is no facility to set the HMAC key
in Node, it's best to have these disabled when using crypto.Cipher
as all usage is wrong by definition.
Fixes: #43040
Reference: https://www.openssl.org/docs/man1.1.1/man3/EVP_aes_128_cbc_hmac_sha1.html