Attention is currently required from: cron2, d12fk, plaisthos, razvanc.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1906?usp=email
to review the following change.
Change subject: openvpnserv: don't allow '/' in config paths
......................................................................
openvpnserv: don't allow '/' in config paths
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]>
Tested-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
Message-Id: <[email protected]>
URL:
https://www.mail-archive.com/[email protected]/msg38855.html
Signed-off-by: Gert Doering <[email protected]>
(cherry picked from commit eecebd88a38ffe1571d1a259da87f611b7b08e9c)
---
M src/openvpnserv/validate.c
1 file changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/06/1906/1
diff --git a/src/openvpnserv/validate.c b/src/openvpnserv/validate.c
index b0fb6b85..a59f9b1 100644
--- a/src/openvpnserv/validate.c
+++ b/src/openvpnserv/validate.c
@@ -72,8 +72,13 @@
{
return FALSE;
}
- /* convert fname to full path */
- if (PathIsRelativeW(fname) )
+ /* 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))
{
openvpn_swprintf(tmp, _countof(tmp), L"%ls\\%ls", workdir, fname);
config_file = tmp;
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1906?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I371aafba18d336bcfd3912e92c18301e39bf6087
Gerrit-Change-Number: 1906
Gerrit-PatchSet: 1
Gerrit-Owner: MaxF <[email protected]>
Gerrit-Reviewer: cron2 <[email protected]>
Gerrit-Reviewer: d12fk <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-Reviewer: razvanc <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: cron2 <[email protected]>
Gerrit-Attention: d12fk <[email protected]>
Gerrit-Attention: razvanc <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel