From: "cron2 (Code Review)" Date: Thu, 30 Oct 2025 16:17:18 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="7eacoBx30aE="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: interactive.c: add the upper bound for startupdata size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa Cc: plaisthos , flichtenheld , openvpn-devel --7eacoBx30aE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/13= 31?usp=3Demail ) Change subject: interactive.c: add the upper bound for startupdata size ...................................................................... interactive.c: add the upper bound for startupdata size The size is passed from the limited-privileges process. This check ensures that the service won't allocate more than needed. Reported-by: Joshua Rogers Found-by: ZeroPath (https://zeropath.com/) Change-Id: I75ebf01641db4dcd07041e3b8b3fa8a632d07595 Signed-off-by: Lev Stipakov Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1331 Message-Id: <20251030150432.4689-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 039.html Signed-off-by: Gert Doering --- M src/openvpnserv/interactive.c 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index ce0d4dd..cb31267 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -446,9 +446,9 @@ } size =3D bytes / sizeof(*data); - if (size =3D=3D 0) + if ((size =3D=3D 0) || (size > 4096)) /* our startup data is 1024 wcha= rs at the moment */ { - MsgToEventLog(M_SYSERR, L"malformed startup data: 1 byte received"= ); + MsgToEventLog(M_SYSERR, L"malformed startup data: %lu bytes receiv= ed", size); ReturnError(pipe, ERROR_STARTUP_DATA, L"GetStartupData", 1, &exit_= event); goto err; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1331?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I75ebf01641db4dcd07041e3b8b3fa8a632d07595 Gerrit-Change-Number: 1331 Gerrit-PatchSet: 2 Gerrit-Owner: stipa Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --7eacoBx30aE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

interactive.c: add the upper bound for startupda=
ta size

The size is passed from the limited-privileges process.
T= his check ensures that the service won't allocate
more than needed.<= br>
Reported-by: Joshua Rogers <contact@...2949...>
Found-by: Z= eroPath (https://zeropath.com/)

Change-Id: I75ebf01641db4dcd07041e3b= 8b3fa8a632d07595
Signed-off-by: Lev Stipakov <lev@...515...>
Ac= ked-by: Gert Doering <gert@...1296...>
Gerrit URL: https://gerrit.= openvpn.net/c/openvpn/+/1331
Message-Id: <20251030150432.4689-1-gert@= ...1296...>
URL: https://www.mail-archive.com/openvpn-devel@...1885...= rceforge.net/msg34039.html
Signed-off-by: Gert Doering <gert@...1725...= ..>
---
M src/openvpnserv/interactive.c
1 file changed, 2 inser= tions(+), 2 deletions(-)

diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive=
.c
index ce0d4dd..cb31267 100644
--- a/src/= openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive= .c
@@ -446,9 +446,9 @@
}

size =3D bytes / sizeof(*data);
- if (size =3D=3D 0)
+ if ((size =3D=3D 0) || (size >= ; 4096)) /* our startup data is 1024 wchars at the moment */
{
- MsgTo= EventLog(M_SYSERR, L"malformed startup data: 1 byte received");
+ MsgToEventLog= (M_SYSERR, L"malformed startup data: %lu bytes received", size);<= /span>
ReturnError(pipe, ERROR_STARTUP_DATA, L"GetSt= artupData", 1, &exit_event);
goto err;
}

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

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I75ebf01641db4dcd07041e3b8b3= fa8a632d07595
Gerrit-Change-Number: 1331
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --7eacoBx30aE=--