]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
openvpnserv: Disallow stdin as config unless user is authorized
authorSelva Nair <selva.nair@gmail.com>
Mon, 3 Nov 2025 14:59:56 +0000 (15:59 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 3 Nov 2025 15:16:41 +0000 (16:16 +0100)
Reported by: <stephan@srlabs.de>

Change-Id: I356faeebfade1eed9b40d6700b13621c357ec5ac
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1343
Message-Id: <20251103150002.23187-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34156.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpnserv/validate.c

index 2187fb58b7b89851b167d311469b0a6444f07380..ddaa381a55c83dc5d8d492cf69ccccf75c8f2d22 100644 (file)
@@ -68,6 +68,11 @@ CheckConfigPath(const WCHAR *workdir, const WCHAR *fname, const settings_t *s)
     const WCHAR *config_file = NULL;
     WCHAR config_dir[MAX_PATH];
 
+    /* fname = stdin is special: do not treat it as a relative path */
+    if (wcscmp(fname, L"stdin") == 0)
+    {
+        return FALSE;
+    }
     /* convert fname to full path */
     if (PathIsRelativeW(fname))
     {