[PATCH v1] openvpnserv: don't allow '/' in config paths
Gert Doering <[email protected]>
| Newsgroups | gmane.network.openvpn.devel |
|---|---|
| Message-ID | <[email protected]> |
From: Heiko Hund <[email protected]> Do not allow forward slashes in user provided config paths. The PathCch* functions do not treat them as path separators, leading to "/../" not being canonicalized. That, and the fact that Windows file APIs accept forward slashes leads to possible directory traversal. Discovered and reported by BreachX Zero Day Labs, using Typhon AI Mil v2. Contributing Researcher: Vivek Parikh. Reported-by: Vivek Parikh <[email protected]> CVE: 2026-78043 Github: OpenVPN/openvpn-private-issues#162 Change-Id: I371aafba18d336bcfd3912e92c18301e39bf6087 Signed-off-by: Heiko Hund <[email protected]> Acked-by: Razvan Cojocaru <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1885 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1885 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru <[email protected]> diff --git a/src/openvpnserv/validate.c b/src/openvpnserv/validate.c index 7c0a87b..e3ef8b6 100644 --- a/src/openvpnserv/validate.c +++ b/src/openvpnserv/validate.c @@ -68,6 +68,11 @@ { return FALSE; } + /* do not accept forward slashes in paths, as PathCch* functions do not handle these */ + if (wcschr(workdir, L'/') || wcschr(fname, L'/')) + { + return FALSE; + } /* convert fname to full canonical path */ if (PathIsRelativeW(fname)) {