T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/setup.sh:89- Finding
Unrestricted Passwordless OpenVPN Execution Enables Root Privilege Escalation
- Content
View full analysis
/dev/null sudo chmod 440 "$SUDOERS_FILE" echo " ✅ Sudoers configured" fi ``` The manual setup instructions install a similarly unrestricted rule: ```bash echo "$USER ALL=(ALL) NOPASSWD: /usr/sbin/openvpn, /usr/bin/killall" | sudo tee /etc/sudoers.d/openvpn ``` ### Technical Analysis The generated sudoers rule allows the current user to execute `/usr/sbin/openvpn` as any user, including root, without authentication and without restricting its arguments. OpenVPN configuration files can contain directives that load plugins or invoke external helper scripts when script execution is enabled. Because the sudoers rule allows an arbitrary configuration path and arbitrary OpenVPN options, a local user can supply an attacker-controlled configuration rather than one of the intended VPN provider configurations. The unrestricted rule therefore converts OpenVPN into a passwordless root execution mechanism. Limiting the executable path in sudoers does not establish least privilege when the executable accepts configuration-controlled execution hooks. ### Attack Path 1. A user runs `scripts/setup.sh`. 2. The script creates `/etc/sudoers.d/vpn-rotate`. 3. The user receives passwordless permission to invoke OpenVPN with arbitrary arguments. 4. The user creates or obtains an OpenVPN configuration containing privileged command or plugin hooks. 5. The user invokes `/usr/sbin/openvp ...[truncated 532 chars]- Remediation
View remediation
