
pfSense CE 2.9.0-DEVELOPMENT - High - Remote - Privilege leftover - wizard uid 0
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · pfsense-wizard-uid0
Class: Privilege leftover Reach: Remote
pfSense CE 2.9.0-DEVELOPMENT (9363ac5) - pfsense.org
wizard.php?xml=setup_wizard.xml step 7 getUserEntryByUID(0) plus local_user_set_password(). Privilege MATCH wizard.php* has no warn-root. xml= is realpath-prefixed under /usr/local/www/wizards.
| ID | no CVE yet |
| Class | Privilege leftover |
| Reach | Remote (authenticated WebGUI unless noted) |
| CWE | CWE-269 |
| CVSS | High: 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| Product | pfSense CE |
| Affected | 2.9.0-DEVELOPMENT (9363ac5b8651a1c7a333180425ce7719070f95f9) |
| Auth | WebGUI session with page-pfsensewizardsubsystem |
| License | GNU Affero GPL v3.0 |
| Lab | 127.0.0.1 only |
I pinned public master 9363ac5. The lab is a PHP gadget of the pinned sink, loopback HTTP on 127.0.0.1:19020.
Series write-up: https://abraxaslabs.tech/research/pfsense-ce-leftovers
| Method | Sink | Privilege |
|---|---|---|
| POST wizard.php?xml=setup_wizard.xml step 7 | getUserEntryByUID(0) local_user_set_password | Integrity: Lab-proven: step 7 rewrote the uid 0 bcrypt hash. xml= LFI closed (../etc/passwd and absolute path rejected). |
| same leftover | same sink | Recon: Inferred: same wizard rewrites WAN/LAN/DHCP/hostname. |
| same leftover | same sink | Availability: Inferred: lock the operator out of the LAN. |
Requires: page-pfsensewizardsubsystem. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Requires: page-pfsensewizardsubsystem. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
xml= realpath prefix LFI. page-system-usermanager is warn-root for the same class.
No Diagnostics: Command unless that page is also granted.
cd lab
./run.sh
Loopback 127.0.0.1:19020. Compose project pfsense-wizard-uid0. Witness PFSENSE-WIZARD-UID0-WITNESS. Loopback only: 127.0.0.1:19020. Compose project pfsense-wizard-uid0. Witness PFSENSE-WIZARD-UID0-WITNESS. PHP gadget of the pinned lines. Stack tears down after the run.
Last line:
SUCCESS PFSENSE-WIZARD-UID0 lfi-closed=yes control-no-hash-change=yes trigger-uid0-hash-change=yes wizard-no-warn-root=yes usermanager-warn-root=yes PFSENSE-WIZARD-UID0-WITNESS
Mark wizard.php standard-warning-root, or drop uid 0 password from the setup wizard after first boot.
9363ac5b8651a1c7a333180425ce7719070f95f9