
pfSense CE 2.9.0-DEVELOPMENT - High - Remote - RCE - CP HA host into pfctl
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · pfsense-cp-ha-pfctl
Class: RCE Reach: Remote
pfSense CE 2.9.0-DEVELOPMENT (9363ac5) - pfsense.org
captiveportal_load_pfctl runs mwexec("/usr/bin/printf "{$rules}" | /sbin/pfctl -a {$anchor}/{$host} -f-") with $host unquoted. backwardsyncip is not is_ipaddr.
| ID | no CVE yet |
| Class | RCE |
| Reach | Remote (authenticated WebGUI unless noted) |
| CWE | CWE-78 |
| 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-services-captiveportal-hasync |
| 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:18990.
Series write-up: https://abraxaslabs.tech/research/pfsense-ce-leftovers
| Method | Sink | Privilege |
|---|---|---|
| HA sync host / MAC into captiveportal_load_pfctl | mwexec printf | pfctl -a {$anchor}/{$host} -f- |
| same leftover | same sink | Recon: Inferred: root shell. Peer blob / MITM plant of that host is inferred, not this gadget. |
| same leftover | same sink | Availability: Inferred: flush CP pf anchors. |
Requires: page-services-captiveportal-hasync. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Requires: page-services-captiveportal-hasync. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
SA-26_05 widget XSS. #16339 status-output password sanitize.
No Diagnostics: Command unless that page is also granted.
cd lab
./run.sh
Loopback 127.0.0.1:18990. Compose project pfsense-cp-ha-pfctl. Witness PFSENSE-CP-HA-PFCTL-WITNESS. Loopback only: 127.0.0.1:18990. Compose project pfsense-cp-ha-pfctl. Witness PFSENSE-CP-HA-PFCTL-WITNESS. PHP gadget of the pinned lines. Stack tears down after the run.
Last line:
SUCCESS PFSENSE-CP-HA-PFCTL control-clean=yes trigger-exec=yes PFSENSE-CP-HA-PFCTL-WITNESS
escapeshellarg $host and $anchor. is_ipaddr / is_macaddr the HA fields.
9363ac5b8651a1c7a333180425ce7719070f95f9