Commit Graph

9 Commits (f20062edd5e4d435ac966a1eed913e63c98df1b3)

Author SHA1 Message Date
Selva Nair 4547dd95fc Validate the service pipe to avoid connecting to a bogus pipe
If an attacker with SeImeprsonatePrivilege manages to create a
namedpipe server with a name matching that used by the "Interactive
Service", the GUI connecting to it could allow the attacker to
impersonate the GUI user.

Fix by validating the service pipe by comparing the pid of the pipe
server with that of the "Interactive Service".

Note: GetNamedPipeServerProcessId() returns the pid of the process
that created the first instance of the pipe. So, this patch only
guards against a rogue pipe instance created before the service
has started. This has to work in combination with a patch for the
service that disallows creation of additional pipe instances when
the service is running.

CVE: CVE-2024-4877
Reported by: Zeze with TeamT5 <zeze7w@gmail.com>

Acked-by: Lev Stipakov <lstipakov@gmail.com>
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2024-06-19 16:46:41 +02:00
Frank Lichtenheld 2cb3c6e417 Reformat source code with uncrustify
Closes: #445

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2023-07-14 11:12:16 +02:00
Lev Stipakov 6924b09a35 service: change CheckServiceStatus() return type to VOID
CheckServiceStatus() return value is never used - the status
is set to global options_t struct.

While on it, remove unneccessary "false" argument
and reformat the code.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-10-20 21:25:38 -04:00
Selva Nair 577d982b51 PLAP: try to start automatic service if not running
Connection profiles shown on the login screen using PLAP
requires automatic service that starts openvpn.exe
processes for these profiles.

This commit adds an attempt to start the service from
PLAP dll. The service is started only if any PLAP enabled
profiles are found.

As starting the service can spawn up OpenVPN.exe processes and
the GUI may attach to them, auto-connect in the GUI is
suspended during session lock to leave the connections free to
be controlled from PLAP screen.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-10-19 09:49:15 -04:00
Selva Nair 8f0dbbc8a3 Always check status of automatic service
- Remove service-only mode (start/stop service) which has not been in
  use since we moved to running the GUI as limited user.
  Also its not very useful as it does not allow any control of
  service-started daemons

- Keep CheckServiceStatus and always check the status of
automatic service.

The status of the service will be used to toggle supporting
control of persistent connections started by the service.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-08-08 10:11:25 -04:00
Selva Nair 43d0ef3a5a Handle interactive service policy restrictions
When a connection is attempted using a config in a location
that would fail, offer an option to add the user to the "OpenVPN
Administrators" group. This is done using shell-execute which will
show a UAC prompt for elevation. If it fails (due to user chooses
NO or the UAC dialog fails) the connection is not started.

v2 Changes
 - Rebase to master
 - Automaticlaly add the admin group if it doesn't exist
 - Allow unicode strings in debug output
 - Use domain\username to identify user
 - Fix the PrintDebug macro

Minor changes based on user feedback
 - Bring the window back to foreground after UAC prompt completion
 - Show a message if another connection is tried during authorization
 - Do not add user to ovpn_admin_group if it is same as the built-in admin group

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2016-03-13 20:23:20 -04:00
Selva Nair 77538dd0d0 Support user and global config directories
- Set default config directory (config_dir) to %UserProfile%\OpenVPN\config
  (saved and read back from HKCU\Software\OpenVPN-GUI\config_dir)

- Add a global_config_dir variable read from HKLM\Software\OpenVPN\config_dir
  or set to OpenVPN-install-path\config

- Scan both directories and their sub directories for connection profiles.
  In case of name conflicts config_dir gets priority over global_config_dir

- Eliminate multiple warnings of duplicate configs

Fixed on review (Thanks to leobasilio@gmail.com)

- Fix wrongly used o.config_dir in 2 locations
- Unrelated: Added missing  CheckIServiceStatus to service.h

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2016-03-01 15:50:02 -05:00
Heiko Hund 3046f8a345 convert files to unix style end-of-line 2012-03-28 10:44:54 +00:00
Heiko Hund fd9e4ae6db import of openvpn-gui-1.0.3.zip
git-svn-id: https://openvpn-gui.svn.sourceforge.net/svnroot/openvpn-gui/trunk@2 43a1345a-9c20-4331-951f-9845fc178312
2008-12-18 11:08:35 +00:00