Project

General

Profile

Actions

Bug #15856

closed

OpenVPN Status Page and Dashboard Widget use input values without validation

Added by Jim Pingle 6 months ago. Updated 4 days ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
OpenVPN
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
25.03
Release Notes:
Default
Affected Version:
All
Affected Architecture:

Description

When performing operations using the OpenVPN status page (/status_openvpn.php) or the Dashboard widget (/widgets/widgets/openvpn.widget.php), user input from the remipp variable is sent to the OpenVPN management socket without validation. By manipulating the content of this variable it is possible to send additional arbitrary OpenVPN management commands through the management socket.

Output from the OpenVPN management commands is not returned to the user, but the commands can perform actions such as changing the log verboseness or causing the daemon to exit, resulting in a denial of service. Changes made using these commands do not persist across restarts of a OpenVPN daemons.

Values involved in these commands should be checked for proper form and rejected if they do not match the expected format. It may also be beneficial to strip newlines or other control characters from values being sent to the management socket.


Files

poc-15856.py (1.21 KB) poc-15856.py Jim Pingle, 11/20/2024 06:16 PM
Actions #1

Updated by Jim Pingle 6 months ago

Attaching a small POC Python script. Edit and adjust the URL, and credentials, target page, and port to match the setup being tested. It executes a command to terminate the daemon, which is easily confirmed by checking the service status after running the script.

Actions #3

Updated by Jim Pingle 6 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Jim Pingle 6 months ago

I merged the changes, they are ready for additional testing.

Actions #5

Updated by Jim Pingle 5 months ago

  • Plus Target Version changed from 25.01 to 25.03
Actions #7

Updated by Lev Prokofev 5 months ago

Fix working, tested on 24.03

Before fix:


prokleon@pfctl:~$ sudo python3 py.script
|server7|5
signal SIGTERM|-1|

After:

prokleon@pfctl:~$ sudo python3 py.script
invalid input
Actions #8

Updated by Jim Pingle 5 months ago

I'm still waiting to hear back from the original reporter to see if it fixed it for them, too, so keeping this open yet.

Actions #9

Updated by Jim Pingle 5 months ago

  • Status changed from Feedback to Resolved

Original reporter responded back that the last round of fixes corrected the problem, so this can be closed now.

Actions #10

Updated by Jim Pingle 4 days ago

  • Private changed from Yes to No
Actions

Also available in: Atom PDF