]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
proto: correct 802.1Q length check in is_ipv_X
authorrootvector2 <dxbnaveed.k@gmail.com>
Wed, 15 Jul 2026 20:22:02 +0000 (22:22 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 16 Jul 2026 21:10:36 +0000 (23:10 +0200)
Github: OpenVPN/openvpn#1044

This has also been reported twice as a security relevant bug, but
only later than the original finding - and it isn't.

While --client-nat would modify a 32bit integer "after the packet"
(the place where an IPv4 address would be, in a well-formed packet),
the underlying buffer is always max-frame sized, and we never look
at the "modified integer" afterwards, so there are no consequences
warranting allocation of a CVE ID.

Signed-off-by: rootvector2 <dxbnaveed.k@gmail.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1789
Reported-By: 章鱼哥 (www.aipyaipy.com)
Reported-By: Yu Zhang Wong <wongyuzhang45@gmail.com>
Change-Id: I8219c6295acf28ff10ddb2fcc285f813c42fa8fe
Message-Id: <20260715202210.9010-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37652.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/proto.c

index 13fe0a54817b4e0e30f2f56d283c3b9c22a4ab51..785c021ffaa462562147bc0659c43b8bf8548e7f 100644 (file)
@@ -70,7 +70,7 @@ is_ipv_X(int tunnel_type, struct buffer *buf, int ip_ver)
         if (proto == htons(OPENVPN_ETH_P_8021Q))
         {
             const struct openvpn_8021qhdr *evh;
-            if (BLENZ(buf) < sizeof(struct openvpn_ethhdr) + sizeof(struct openvpn_iphdr))
+            if (BLENZ(buf) < sizeof(struct openvpn_8021qhdr) + sizeof(struct openvpn_iphdr))
             {
                 return false;
             }