
pfSense CE 2.9.0-DEVELOPMENT - High - Remote - RCE - IPv6 zone into dpinger
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · pfsense-gw-ipv6-zone
Class: RCE Reach: Remote
pfSense CE 2.9.0-DEVELOPMENT (9363ac5) - pfsense.org
is_ipaddrv6() strips %zone for Net_IPv6::checkIPv6 and never charset-checks the zone. start_dpinger interpolates {$gateway['monitor']} into mwexec with no escapeshellarg. Empty monitor copies the gateway IP.
| 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-system-gateways-editgateway then apply |
| 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:18930.
Series write-up: https://abraxaslabs.tech/research/pfsense-ce-leftovers
| Method | Sink | Privilege |
|---|---|---|
| POST system_gateways_edit.php gateway/monitor IPv6%zone | start_dpinger mwexec {$gateway['monitor']} | Integrity: Lab-proven: fe80::1%eth0;w still passed is_ipaddrv6; mwexec /bin/sh -c ran extra w. |
| same leftover | same sink | Recon: Inferred: root shell can read host files. |
| same leftover | same sink | Availability: Inferred: kill or replace dpinger monitoring. |
Requires: page-system-gateways-editgateway then apply. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Requires: page-system-gateways-editgateway then apply. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Gateway name is is_validaliasname. Unauth N/A.
No Diagnostics: Command unless that page is also granted.
cd lab
./run.sh
Loopback 127.0.0.1:18930. Compose project pfsense-gw-ipv6-zone. Witness PFSENSE-GW-IPV6-ZONE-WITNESS. Loopback only: 127.0.0.1:18930. Compose project pfsense-gw-ipv6-zone. Witness PFSENSE-GW-IPV6-ZONE-WITNESS. PHP gadget of the pinned lines. Stack tears down after the run.
Last line:
SUCCESS PFSENSE-GW-IPV6-ZONE control-no-extra=yes trigger-extra-exec=yes PFSENSE-GW-IPV6-ZONE-WITNESS
Charset-check the zone. escapeshellarg monitor before mwexec. Prefer argv arrays.
9363ac5b8651a1c7a333180425ce7719070f95f9