
pfSense CE 2.9.0-DEVELOPMENT - High - Remote - Privilege leftover - LDAP admin name
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · pfsense-ldap-name-collision
Class: Privilege leftover Reach: Remote
pfSense CE 2.9.0-DEVELOPMENT (9363ac5) - pfsense.org
getUserEntry($name) returns the local row on name match. isAdminUID() then sees uid 0 and isAllowedPage allows every page. passwordmg treats the session as local and writes that user's hash. uid == 0 is a loose compare.
| 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 remote WebGUI login when authmode != Local; passwordmg is not warn-root |
| 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:19010.
Series write-up: https://abraxaslabs.tech/research/pfsense-ce-leftovers
| Method | Sink | Privilege |
|---|---|---|
| LDAP/RADIUS bind as local admin name, then POST passwordmg | getUserEntry / isAdminUID / local_user_set_password | Integrity: Lab-proven: remote admin is isAdminUID; all pages including diag_command; passwordmg set the uid 0 hash. Stub-only remote names fail closed. |
| same leftover | same sink | Recon: Lab-proven: allow flag for every page. |
| same leftover | same sink | Availability: None shown. |
Requires: remote WebGUI login when authmode != Local; passwordmg is not warn-root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Requires: remote WebGUI login when authmode != Local; passwordmg is not warn-root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Stub-only remote names. usermanager itself is warn-root. SA-26_22 xmlrpc uid skip is a different bug.
No Diagnostics: Command unless that page is also granted.
cd lab
./run.sh
Loopback 127.0.0.1:19010. Compose project pfsense-ldap-name-collision. Witness PFSENSE-LDAP-NAME-COLLISION-WITNESS. Loopback only: 127.0.0.1:19010. Compose project pfsense-ldap-name-collision. Witness PFSENSE-LDAP-NAME-COLLISION-WITNESS. PHP gadget of the pinned lines. Stack tears down after the run.
Last line:
SUCCESS PFSENSE-LDAP-NAME-COLLISION control-isadmin=no control-diag=no control-hash-unchanged=yes trigger-isadmin=yes trigger-all-pages=yes trigger-hash-set=yes uid-loose-eq=yes PFSENSE-LDAP-NAME-COLLISION-WITNESS
Do not map a remote name onto a local uid 0 row. Use strict uid === '0' plus auth source. Make passwordmg warn-root.
9363ac5b8651a1c7a333180425ce7719070f95f9