Patches in Master that were privately reviewed
Hi,
as you have seen, there was a 2.7_rc2 release and a 2.6.16 release today. Both have seen fixes that were considered CVE worthy, and we do review and ACK these fixes privately, for a coordinated release.
I'm sending the "master" patches in this patch series. Release/2.6 has only the "memcmp()" patch.
We do not think that the "reject mismatched address family" patch can be used to do something really nasty (like "crash openvpn" or "get access to memory with interesting secrets in it") - but it is a buffer over-read, and you never know, so fix it, and tag it properly.
The "memcmp check" patch can be used for state exhaustion attacks against an OpenVPN server (read: send legitimately-looking packets from random source addresses, each opening a new TLS session, eating CPU and memory). Technically, this has always been possible, "since ever", and this check was introduced in 2.6.0 to do a syn-cookie-like source IP verification (do not add state in the first packet, only add state if the proper cookie comes back later) - which did not work the way it was intended. But for whatever reasons, reflection attacks using OpenVPN and state exhaustion attacks have fallen out of favour, so nobody ever noticed... but if you run a server, you want to update.
The commits in tree are:
commit 18c483dd6031d86eb393527855734e8cd62fea19
Author: Arne Schwabe <[email protected]...> Date: Mon Oct 27 10:05:55 2025 +0100
Fix memcmp check for the hmac verification in the 3way handshake being inverted
CVE: 2025-13086
commit f1b851dae60eb1e277315dfe6265e3a58660b16a
Author: Mikhail Khachaiants <[email protected]...> Date: Sat Oct 18 11:42:31 2025 +0300
socket: reject mismatched address family in get_addr_generic
CVE: 2025-12106
(This mail is created with git-send-email --compose, which alas does not easily permit PGP signing. It's still me, and you can verify the commits in the repo - and the changes are straightforward enough. The v2.7_rc2 and 2.6.16 commits & tags *are* signed.)
gert
PATCH 1/2 socket: reject mismatched address family in get_addr_generic
From: Mikhail Khachaiants <[email protected]...>
Add a family check to prevent copying address data of the wrong type, which could cause buffer over-read when parsing routes or endpoints.
CVE: 2025-12106
Github: OpenVPN/openvpn-private-issues#77
--- src/openvpn/socket.c | 7 +++++++ 1 file changed, 7 insertions(+)
src/openvpn/socket.c +7 -0
@@ -147,6 +147,13 @@ get_addr_generic(sa_family_t af, unsigned int flags, const char *hostname, voidstruct in6_addr *ip6;in_addr_t *ip4; +if (af != ai->ai_family) + { +msg (msglevel,"Can't parse %s as IPv%d address" , var_host, (af ==AF_INET ) ?4 :6 ); + ret =-1 ; + goto out; + } +switch (af) {case AF_INET :
Signature · 1 line
2.51.2
PATCH 2/2 Fix memcmp check for the hmac verification in the 3way handshake being inverted
In reply to Gert DoeringFrom: Arne Schwabe <[email protected]...>
This is a stupid mistake but causes all hmac cookies to be accepted,
thus breaking source IP address validation. As a consequence, TLS
sessions can be openend and state can be consumed in the server from IP addresses that did not initiate an initial connection.
While at it, fix check to only allow [t-2;t] timeslots, disallowing HMACs coming in from a future timeslot.
Github: OpenVPN/openvpn-private-issues#56
CVE: 2025-13086
--- src/openvpn/ssl_pkt.c | 7 ++-- tests/unit_tests/openvpn/test_pkt.c | 58 ++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 4 deletions(-)
src/openvpn/ssl_pkt.c +4 -3
@@ -548,13 +548,14 @@ check_session_hmac_and_pkt_id(struct tls_pre_decrypt_state *state, } -/* check adjacent timestamps too */ -for (int offset =-2 ; offset <=1 ; offset++) +/* check adjacent timestamps too, the handwindow is split in 2 for the +* offset, so we check the current timeslot and the two before that */ +for (int offset =-2 ; offset <=0 ; offset++) {struct session_id expected_id =calculate_session_id_hmac (state->peer_session_id, from, hmac, handwindow, offset); -if (memcmp_constant_time (&expected_id, &state->server_session_id,SID_SIZE )) +if (memcmp_constant_time (&expected_id, &state->server_session_id,SID_SIZE ) ==0 ) {return true; }
tests/unit_tests/openvpn/test_pkt.c +57 -1
94 lines not on this page · raw message
Signature · 1 line
2.51.2