-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
OpenSSL 1.0.2: BIO_read + *_WRAP ciphers copy to uninitialized pointer #8688
Comments
So, in 1.1.0+, |
I'm going to check what happens exactly, but certainly no memory violation occurs in git master. |
Yeah, compiled against git master, BIO_set_cipher returns 0. 140324479227776:error:0607B0AA:digital envelope routines:EVP_CipherInit_ex:wrap mode not allowed:crypto/evp/evp_enc.c:161: |
The same check exists in 1.0.2, so, yes, this looks to be because BIO_set_cipher is declared void in 1.0.2. If 1.0.2 was in bug fix mode I think I would probably recommend handling this with a documentation change. Since 1.0.2 is security-fix only, and that wouldn't be a security fix, I think probably we just close this. |
Tested on https://www.openssl.org/source/openssl-1.0.2r.tar.gz
The internal iv pointer is never initialized and memory is copied to this pointer.
I can construct PoC code if desired. Is is very similar to OpenSSL::OpSymmetricEncrypt_BIO except that the return value of
BIO_set_cipher
is not checked.I assume this can happen because in OpenSSL 1.0.2,
BIO_set_cipher
does not return a value and therefore cannot indicate failure.I've observed it with
AES_128_WRAP
in encryption mode, but may also apply to other _WRAP ciphers and decryption mode.This is just a heads-up. I'm aware 1.0.2 is a security-fix-only branch and that using a _WRAP cipher with
BIO_f_cipher()
is sufficiently rare that it does not prompt a new release, so you may close the issue once you've seen it.The text was updated successfully, but these errors were encountered: