]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix potential double-free in --x509-alt-username (CVE-2017-7521)
authorSteffan Karger <steffan.karger@fox-it.com>
Mon, 19 Jun 2017 09:28:40 +0000 (11:28 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 19 Jun 2017 18:43:08 +0000 (20:43 +0200)
commit1dde0cd6e5e6a0f2f45ec9969b7ff1b6537514ad
treee272ec8fcab9cd43d74257f4b7651772162bcc3a
parenta6dbec1cb481d6f0237372a7dec059f1c572b7b7
Fix potential double-free in --x509-alt-username (CVE-2017-7521)

We didn't check the return value of ASN1_STRING_to_UTF8() in
extract_x509_extension().  Ignoring such a failure could result in buf
being free'd twice.  An error in ASN1_STRING_to_UTF8() can be caused
remotely if the peer can make the local process run out of memory.

The problem can only be triggered for configurations that use the
--x509-alt-username option with an x509 extension (i.e. the option
parameter starts with "ext:").

This issue was discovered, analysed and reported to the OpenVPN team by
Guido Vranken.

Extensive testing by Guido Vranken gives confidence that this function
is very unlikely to fail in real-world usage (using subjectAltName or
issuerAltName extensions) for other reasons than memory exhaustion.

CVE: 2017-7521
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@openvpn.net>
Acked-by: Guido Vranken <guidovranken@gmail.com>
Message-Id: <1497864520-12219-6-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/search?l=mid&q=1497864520-12219-6-git-send-email-steffan.karger@fox-it.com
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit cb4e35ece4a5b70b10ef9013be3bff263d82f32b)
src/openvpn/ssl_verify_openssl.c