From: "flichtenheld (Code Review)" Date: Tue, 13 Jan 2026 12:44:01 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <8722f6924e25ede459fd51131eae6e3b46d39bea-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ZbTRtgOZPHw="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: socks: In establish_socks_proxy_udpassoc check result of recv_socks_r... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --ZbTRtgOZPHw= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1469?usp=3Demail to review the following change. Change subject: socks: In establish_socks_proxy_udpassoc check result of re= cv_socks_reply ...................................................................... socks: In establish_socks_proxy_udpassoc check result of recv_socks_reply Not just check the return value but also that relay_addr is valid. recv_socks_reply doesn't care whether the answer is what we expected. This is probably a very unlikely edge case but it doesn't hurt to check for it here. Reported-By: Joshua Rogers Found-By: ZeroPath (https://zeropath.com) Github: openvpn-private-issues#13 Change-Id: Ic1c8f24de423541bdc85e70b5a688213800d86de Signed-off-by: Frank Lichtenheld --- M src/openvpn/socks.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/69/1469/1 diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c index 078b4e1..5cb5912 100644 --- a/src/openvpn/socks.c +++ b/src/openvpn/socks.c @@ -412,8 +412,7 @@ send(ctrl_sd, "\x05\x03\x00\x01\x00\x00\x00\x00\x00\x00", 10, = MSG_NOSIGNAL); if (size !=3D 10) { - msg(D_LINK_ERRORS | M_ERRNO, - "establish_socks_proxy_passthru: TCP port write failed on = send()"); + msg(D_LINK_ERRORS | M_ERRNO, "%s: TCP port write failed on sen= d()", __func__); goto error; } } @@ -424,6 +423,11 @@ { goto error; } + if (!relay_addr->addr.in4.sin_addr.s_addr) + { + msg(D_LINK_ERRORS, "%s: Socks proxy did not answer with IPv4 addre= ss", __func__); + goto error; + } return; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1469?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ic1c8f24de423541bdc85e70b5a688213800d86de Gerrit-Change-Number: 1469 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --ZbTRtgOZPHw= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

socks: In establish_socks_proxy_udpassoc ch=
eck result of recv_socks_reply

Not just check the return value but a= lso that relay_addr
is valid. recv_socks_reply doesn't care whether = the answer
is what we expected. This is probably a very unlikely edgecase but it doesn't hurt to check for it here.

Reported-By: Jos= hua Rogers <contact@...2949...>
Found-By: ZeroPath (https://zeropa= th.com)
Github: openvpn-private-issues#13
Change-Id: Ic1c8f24de423541= bdc85e70b5a688213800d86de
Signed-off-by: Frank Lichtenheld <frank@...493...= 2641...>
---
M src/openvpn/socks.c
1 file changed, 6 insertions= (+), 2 deletions(-)

git pull ssh://gerrit.openvp=
n.net:29418/openvpn refs/changes/69/1469/1
diff --git a/src/openvpn=
/socks.c b/src/openvpn/socks.c
index 078b4e1..5cb5912 10064= 4
--- a/src/openvpn/socks.c
+++ b/src/openv= pn/socks.c
@@ -412,8 +412,7 @@
= send(ctrl_sd, "\x05\x03\x00\x01\x00\x00\x00\x00\x00\x00", 10, MS= G_NOSIGNAL);
if (size !=3D 10)
= {
- ms= g(D_LINK_ERRORS | M_ERRNO,
- "establish_socks_proxy_passthru: TCP port write f= ailed on send()");
+ msg(D_LINK_ERRORS | M_ERRNO, "%s: TCP port write faile= d on send()", __func__);
goto error;
}
}
@@ -424,6 +42= 3,11 @@
{
goto error;<= br> }
+ = if (!relay_addr->addr.in4.sin_addr.s_addr)
+ {
+ msg(D_LINK_ERRORS, "%s: Socks proxy did not answer= with IPv4 address", __func__);
+ goto error;
+ }

return;


To view, visit change 1469. To= unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic1c8f24de423541bdc85e70b5a6= 88213800d86de
Gerrit-Change-Number: 1469
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --ZbTRtgOZPHw=--