
pfSense CE 2.9.0-DEVELOPMENT - Medium - Remote - Config injection - ISC dhcpd filename
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · pfsense-dhcpd-conf
Class: Config injection Reach: Remote
pfSense CE 2.9.0-DEVELOPMENT (9363ac5) - pfsense.org
services_dhcpdv4_configure interpolates filename "{$sm['filename']}"; with no addslashes. GUI stores $_POST['filename'] with no quote/newline gate. Kea JSON is SA-26_20 skip.
| ID | no CVE yet |
| Class | Config injection |
| Reach | Remote (authenticated WebGUI unless noted) |
| CWE | CWE-74 |
| CVSS | Medium: 5.4 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L |
| Product | pfSense CE |
| Affected | 2.9.0-DEVELOPMENT (9363ac5b8651a1c7a333180425ce7719070f95f9) |
| Auth | WebGUI session with page-services-dhcpserver-editstaticmapping |
| 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:19250.
Series write-up: https://abraxaslabs.tech/research/pfsense-ce-leftovers
| Method | Sink | Privilege |
|---|---|---|
| POST services_dhcp_edit.php filename | filename "{$sm['filename']}"; | Integrity: Lab-proven: extra option tftp-server-name in chroot conf. Filename never reached argv. |
| same leftover | same sink | Recon: None shown. |
| same leftover | same sink | Availability: Inferred: parse-fail dhcpd or extra PXE option. |
Requires: page-services-dhcpserver-editstaticmapping. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Requires: page-services-dhcpserver-editstaticmapping. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Host shell. Files outside the chroot. Kea JSON. hostname charset. numberoptions text quotes.
No Diagnostics: Command unless that page is also granted.
cd lab
./run.sh
Loopback 127.0.0.1:19250. Compose project pfsense-dhcpd-conf. Witness PFSENSE-DHCPD-CONF-WITNESS. Loopback only: 127.0.0.1:19250. Compose project pfsense-dhcpd-conf. Witness PFSENSE-DHCPD-CONF-WITNESS. PHP gadget of the pinned lines. Stack tears down after the run.
Last line:
SUCCESS PFSENSE-DHCPD-CONF control-one-filename=yes trigger-extra-statement=yes PFSENSE-DHCPD-CONF-WITNESS
addslashes / reject quote and newline in filename/rootpath/ldap/DUID.
9363ac5b8651a1c7a333180425ce7719070f95f9