Bug #16743
closed``isvalidpid()`` function does not properly check or escape PID file parameter
100%
Description
The isvalidpid() function takes a $pidfile parameter and executes a shell command using that parameter without checking if the file exists first or escaping the file before execution.
As a consequence, it is possible in certain circumstances for an authenticated user to pass parameters to the function resulting in command execution.
A specific example is stopping an OpenVPN service via status_services.php. The code that handles stopping the service uses the id parameter when forming a PID file path, and since that value is not fully validated, a malicious value can trigger command execution.
Users must be authenticated and have privileges to access status_services.php to trigger the issue in that manner.
Simple POC attached.
Files
Updated by Jim Pingle 22 days ago
- Status changed from Confirmed to Feedback
- % Done changed from 0 to 100
Applied in changeset commit:54b03ca353a5e6ae14c91ed19bfe30f76493d7e9.
Updated by Jim Pingle 21 days ago
- Plus Target Version changed from 26.07 to 26.03
Updated by Jim Pingle 15 days ago
- Status changed from Feedback to Closed
I can't reproduce this against any current dev snapshots or patched instances. Looks good, closing.