]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Check message id/acked ids too when doing sessionid cookie checks
authorArne Schwabe <arne@rfc2549.org>
Tue, 16 Sep 2025 15:52:50 +0000 (17:52 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 17 Sep 2025 09:41:45 +0000 (11:41 +0200)
commit68c01720eecc1772b3f648b9e043e396d943f632
treed3480f7facd1cad31ae2e2d6c20f15611ec1e452
parentd383d6ed6270b8d1f95716d08e9da3dd0d712f2d
Check message id/acked ids too when doing sessionid cookie checks

This fixes that control packets on a floating client can trigger
creating a new session in special circumstances:

To trigger this circumstance a connection needs to

- starts on IP A
- successfully floats to IP B by data packet
- then has a control packet from IP A before any
  data packet can trigger the float back to IP A

and all of this needs to happen in the 60s time
that hmac cookie is valid in the default
configuration.

In this scenario we would trigger a new connection as the HMAC
session id would be valid.

This patch adds checking also of the message-id and acked ids to
discern packet from the initial three-way handshake where these
ids are 0 or 1 from any later packet.

This will now trigger (at verb 4 or higher) a messaged like:

   Packet (P_ACK_V1) with invalid or missing SID

instead.

Also remove a few duplicated free_tls_pre_decrypt_state in test_ssl.

Reported-By: Walter Doekes <walter.openvpn@wjd.nu>
Tested-By: Walter Doekes <walter.openvpn@wjd.nu>
Change-Id: I6752dcd5aff3e5cea2b439366479e86751a1c403
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: MaxF <max@max-fillinger.net>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1184
Message-Id: <20250916155258.6864-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32990.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(backported from commit 518e122b42739b0dbb54e7169a8a3aadb4773125)
src/openvpn/mudp.c
src/openvpn/ssl_pkt.c
src/openvpn/ssl_pkt.h
tests/unit_tests/openvpn/test_pkt.c