From: "cron2 (Code Review)" Date: Mon, 24 Nov 2025 17:56:21 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., selva.nair@...277..., openvpn-devel@lists.sourceforge.net, lstipakov@...277... Message-ID: <66cc059a442fea08cbb177bf2f3ca05bf303580a-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="/CtquBEvtmI="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Restrict access to the service pipe to SYSTEM and owner List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: selvanair , plaisthos , stipa Cc: d12fk , openvpn-devel --/CtquBEvtmI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#3) to the change originally created by= selvanair. ( http://gerrit.openvpn.net/c/openvpn/+/1397?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Restrict access to the service pipe to SYSTEM and owner ...................................................................... Restrict access to the service pipe to SYSTEM and owner Access is restricted to SYSTEM and pipe client user (the user starting openvpn.exe). The default is full access to Administrtors, owner, and read access to everyone. This hardens the pipe further. Change-Id: I8aa1cf1585e2320fca9329bdd0227976606fe71e Signed-off-by: Selva Nair Acked-by: Lev Stipakov Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1397 Message-Id: <20251124165353.14923-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 640.html Signed-off-by: Gert Doering --- M src/openvpnserv/interactive.c 1 file changed, 18 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/97/1397/3 diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index afa8047..dbb5a4b 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -3417,9 +3417,26 @@ GetCurrentThreadId(), pipe_uuid_str); RpcStringFree(&pipe_uuid_str); + /* make a security descriptor for the named pipe with access + * restricted to the user and SYSTEM + */ + + SECURITY_ATTRIBUTES sa; + PSECURITY_DESCRIPTOR pSD =3D NULL; + LPCWSTR szSDDL =3D L"D:(A;;GA;;;SY)(A;;GA;;;OW)"; + if (!ConvertStringSecurityDescriptorToSecurityDescriptorW( + szSDDL, SDDL_REVISION_1, &pSD, NULL)) + { + ReturnLastError(pipe, L"ConvertSDDL"); + goto out; + } + sa.nLength =3D sizeof(sa); + sa.lpSecurityDescriptor =3D pSD; + sa.bInheritHandle =3D FALSE; + ovpn_pipe =3D CreateNamedPipe( ovpn_pipe_name, PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE= | FILE_FLAG_OVERLAPPED, - PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT | PIPE_REJEC= T_REMOTE_CLIENTS, 1, 128, 128, 0, NULL); + PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT | PIPE_REJEC= T_REMOTE_CLIENTS, 1, 128, 128, 0, &sa); if (ovpn_pipe =3D=3D INVALID_HANDLE_VALUE) { ReturnLastError(pipe, L"CreateNamedPipe"); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1397?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I8aa1cf1585e2320fca9329bdd0227976606fe71e Gerrit-Change-Number: 1397 Gerrit-PatchSet: 3 Gerrit-Owner: selvanair Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-Reviewer: stipa Gerrit-CC: d12fk Gerrit-CC: openvpn-devel --/CtquBEvtmI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #3 to the change originally created by selvanair.<= /p>

Vi= ew Change

The following approvals got outdated and were removed: Code-Review+2 by cron2

Restrict access to the service pipe=
 to SYSTEM and owner

Access is restricted to SYSTEM and pipe client = user
(the user starting openvpn.exe). The default is
full access to A= dministrtors, owner, and read access
to everyone. This hardens the pipe = further.

Change-Id: I8aa1cf1585e2320fca9329bdd0227976606fe71e
Sig= ned-off-by: Selva Nair <selva.nair@...277...>
Acked-by: Lev Stipak= ov <lstipakov@...277...>
Gerrit URL: https://gerrit.openvpn.net/c/= openvpn/+/1397
Message-Id: <20251124165353.14923-1-gert@...1296...>= ;
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/= msg34640.html
Signed-off-by: Gert Doering <gert@...1296...>
---=
M src/openvpnserv/interactive.c
1 file changed, 18 insertions(+), 1 = deletion(-)

git pull ssh://gerrit.openvpn.net:29=
418/openvpn refs/changes/97/1397/3
diff --git a/src/openvpnserv/int=
eractive.c b/src/openvpnserv/interactive.c
index afa8047..d= bb5a4b 100644
--- a/src/openvpnserv/interactive.c+++ b/src/openvpnserv/interactive.c
@@ -3417,9 +3417= ,26 @@
GetCurrentThreadId(), pipe_uuid_str);<= /span>
RpcStringFree(&pipe_uuid_str);

+ /* make a securit= y descriptor for the named pipe with access
+ * restricted to the user and SYSTEM
= + */
+
+ SECURITY_ATTRIBUTES sa;
+ PSECURITY_DESCRIPTOR pSD =3D NULL;
+ LPCWSTR szSDDL =3D L"D:(= A;;GA;;;SY)(A;;GA;;;OW)";

+ if (!ConvertStringSecurityDescriptorToSecurityDescriptorW(
+ szSDDL, S= DDL_REVISION_1, &pSD, NULL))
+ {
+ = ReturnLastError(pipe, L"ConvertSDDL");
+ goto out;
+ }
+ sa.nLength =3D sizeof(sa);
+ sa.lpSecurityDescriptor =3D pSD;<= br>+ sa.bInheritHandle =3D F= ALSE;
+
ovpn_pipe =3D CreateNamedPipe(

ovpn_pipe_n= ame, PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE | FILE_FLAG_OVERLAP= PED,
- PIPE_TYPE= _MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS, = 1, 128, 128, 0, NULL);
change 1397. To unsubscribe, or for help w= riting mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8aa1cf1585e2320fca9329bdd02= 27976606fe71e
Gerrit-Change-Number: 1397
Gerrit-PatchSet: 3
Gerrit-Owner: selvanair <selva.nair@...1354...= ..>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: d12fk <heiko@...515...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --/CtquBEvtmI=--