Skip to contentSkip to conversation

Possible security bug

Openvpn-devel Alberto Gonzalez Iniesta 3 participants 3 messages Apr 3, 2006 – Apr 4, 2006

lore
Share & tools
lore
#0 lore raw

Hi all,

I have just received the following bug report from the Debian Bug Track System:

--
From: Hendrik Weimer <[email protected]...>

As described in http://www.osreviews.net/reviews/security/openvpn
OpenVPN contains a security hole that allows a malicious VPN server to take over connected clients.

OpenVPN allows to push environment variables to a client via 'push setenv ...'. Using LD_PRELOAD it is possible to run arbitrary code as root. The only prerequisite is that the attacker needs to control a file on the victim's computer, e.g. by returning a specially crafted document upon web access.

A possible solution would be to prefix all pushed environment variables with something like 'OPENVPN_'.
--

What's your opinion on this?

Thanks,

Alberto

Signature · 5 lines
Alberto Gonzalez Iniesta    | Formación, consultoría y soporte técnico
agi@(inittab.org|debian.org)| en GNU/Linux y software libre
Encrypted mail preferred    | http://inittab.com

Key fingerprint = 9782 04E7 2B75 405C F5E9  0C81 C514 AF8E 4BA4 01C3
#1 lore raw

Alberto,

By default, the OpenVPN client doesn't accept pushed options from the server unless "pull" or "client" is specified. The idea is that once you agree to accept configuration info from the server, you are trusting (to a certain extent) in its integrity, so there are limits in how far the client can be protected against a server which successfully authenticates at the SSL/TLS level, but then turns out to be malicious.

But Hendrik has a point in that you might want that trust to be finer-grained -- you might want to accept routes pushed from a server, but not a setenv (which could potentially be abused).

The patch to remove setenv from the set of options which the client will accept from the server (when "pull" or "client" is specified is fairly simple.

Just go to the pull_permission_mask function in init.c and remove the OPT_P_SETENV flag from the mask.

James

Quoted 29 lines · Alberto Gonzalez Iniesta

Hi all,

I have just received the following bug report from the Debian Bug Track System:

--
From: Hendrik Weimer <[email protected]...>

As described in http://www.osreviews.net/reviews/security/openvpn
OpenVPN contains a security hole that allows a malicious VPN server to take over connected clients.

OpenVPN allows to push environment variables to a client via 'push setenv ...'. Using LD_PRELOAD it is possible to run arbitrary code as root. The only prerequisite is that the attacker needs to control a file on the victim's computer, e.g. by returning a specially crafted document upon web access.

A possible solution would be to prefix all pushed environment variables with something like 'OPENVPN_'.
--

What's your opinion on this?

Thanks,

Alberto

#2 lore raw
Quoted 5 lines · James Yonan

Alberto,

By default, the OpenVPN client doesn't accept pushed options from the server unless "pull" or "client" is specified. The idea is that once you agree to accept configuration info from the server, you are trusting (to a certain extent) in its integrity, so there are limits in how far the client can be protected against a server which successfully authenticates at the SSL/TLS level, but then turns out to be malicious.

But Hendrik has a point in that you might want that trust to be finer-grained -- you might want to accept routes pushed from a server, but not a setenv (which could potentially be abused).

Hmm. I actually like Hendrik's proposed solution -- allowing setenv by default, but only to a subset of the possible namespace (by prefixing variable names). Any reason you're leaning towards disabling setenv altogether unless explicitly allowed?