
pfSense CE 2.9.0-DEVELOPMENT - High - Remote - RCE - timezone php.ini prepend
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · pfsense-timezone-phpini
Class: RCE Reach: Remote
pfSense CE 2.9.0-DEVELOPMENT (9363ac5) - pfsense.org
system.php writes $_POST['timezone'] with no in_array against system_get_timezone_list(). is_timezone() only rejects a trailing slash. system_timezone_configure writes /var/db/zoneinfo. rc.php_ini_setup interpolates date.timezone="${TIMEZONE}" into php.ini. Quote plus newline adds auto_prepend_file.
| ID | no CVE yet |
| Class | RCE |
| Reach | Remote (authenticated WebGUI unless noted) |
| CWE | CWE-94 |
| 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-generalsetup |
| 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:18940.
Series write-up: https://abraxaslabs.tech/research/pfsense-ce-leftovers
| Method | Sink | Privilege |
|---|---|---|
| POST system.php timezone | rc.php_ini_setup date.timezone="${TIMEZONE}" | Integrity: Lab-proven: generated php.ini accepted auto_prepend_file; php -c plus a php-fpm analog script ran prepend and wrote the witness. |
| same leftover | same sink | Recon: Inferred: prepend runs as root PHP after php.ini rebuild / php-fpm restart. |
| same leftover | same sink | Availability: Inferred: broken php.ini can take the GUI down until repaired. |
Requires: page-system-generalsetup. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Requires: page-system-generalsetup. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Form_Select is UI only. hostname/domain have their own charset checks. Unauth N/A.
No Diagnostics: Command unless that page is also granted.
cd lab
./run.sh
Loopback 127.0.0.1:18940. Compose project pfsense-timezone-phpini. Witness PFSENSE-TIMEZONE-PHPINI-WITNESS. Loopback only: 127.0.0.1:18940. Compose project pfsense-timezone-phpini. Witness PFSENSE-TIMEZONE-PHPINI-WITNESS. PHP gadget of the pinned lines. Stack tears down after the run.
Last line:
SUCCESS PFSENSE-TIMEZONE-PHPINI control-clean=yes trigger-prepend=yes is-timezone-accepts=yes not-allowlisted=yes PFSENSE-TIMEZONE-PHPINI-WITNESS
in_array timezone against system_get_timezone_list(). Quote-escape the rc.php_ini_setup interpolation.
9363ac5b8651a1c7a333180425ce7719070f95f9