Avoid overflow in EVP_EncodeUpdate
authorMatt Caswell <matt@openssl.org>
Fri, 4 Mar 2016 10:17:17 +0000 (10:17 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 3 May 2016 10:56:23 +0000 (11:56 +0100)
commitee1e3cac2e83abc77bcc8ff98729ca1e10fcc920
tree6cabe5517619baa6bd2e26dca23c18ac77fc6f09
parentb7b8e948014d93e1eb6d954d0799ae68ab0e068b
Avoid overflow in EVP_EncodeUpdate

An overflow can occur in the EVP_EncodeUpdate function which is used for
Base64 encoding of binary data. If an attacker is able to supply very large
amounts of input data then a length check can overflow resulting in a heap
corruption. Due to the very large amounts of data involved this will most
likely result in a crash.

Internally to OpenSSL the EVP_EncodeUpdate function is primarly used by the
PEM_write_bio* family of functions. These are mainly used within the
OpenSSL command line applications, so any application which processes
data from an untrusted source and outputs it as a PEM file should be
considered vulnerable to this issue.

User applications that call these APIs directly with large amounts of
untrusted data may also be vulnerable.

Issue reported by Guido Vranken.

CVE-2016-2105

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/evp/encode.c