Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:Update
openvpn.5844
0025-Fix-bounds-check-in-read_key.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0025-Fix-bounds-check-in-read_key.patch of Package openvpn.5844
From fce34375295151f548a26c2d0eb30141e427c81a Mon Sep 17 00:00:00 2001 From: Steffan Karger <steffan.karger@fox-it.com> Date: Tue, 15 Aug 2017 10:04:33 +0200 Subject: [PATCH] Fix bounds check in read_key() The bounds check in read_key() was performed after using the value, instead of before. If 'key-method 1' is used, this allowed an attacker to send a malformed packet to trigger a stack buffer overflow. Fix this by moving the input validation to before the writes. Note that 'key-method 1' has been replaced by 'key method 2' as the default in OpenVPN 2.0 (released on 2005-04-17), and explicitly deprecated in 2.4 and marked for removal in 2.5. This should limit the amount of users impacted by this issue. CVE: 2017-12166 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> Message-Id: <80690690-67ac-3320-1891-9fecedc6a1fa@fox-it.com> URL: https://www.mail-archive.com/search?l=mid&q=80690690-67ac-3320-1891-9fecedc6a1fa@fox-it.com Signed-off-by: David Sommerseth <davids@openvpn.net> (backport of git master commit 3b1a61e9fb27213c46f76312f4065816bee8ed01) --- src/openvpn/crypto.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/openvpn/crypto.c b/src/openvpn/crypto.c index 517d9a70..2a59f0ff 100644 --- a/src/openvpn/crypto.c +++ b/src/openvpn/crypto.c @@ -1294,13 +1294,14 @@ read_key (struct key *key, const struct key_type *kt, struct buffer *buf) if (!buf_read (buf, &hmac_length, 1)) goto read_err; + if (cipher_length != kt->cipher_length || hmac_length != kt->hmac_length) + goto key_len_err; + if (!buf_read (buf, key->cipher, cipher_length)) goto read_err; if (!buf_read (buf, key->hmac, hmac_length)) goto read_err; - if (cipher_length != kt->cipher_length || hmac_length != kt->hmac_length) - goto key_len_err; return 1; -- 2.13.6
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor