
pfSense CE 2.9.0-DEVELOPMENT - Medium - Remote - File write - DynDNS cache path
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · pfsense-dyndns-cache-path
Class: File write Reach: Remote
pfSense CE 2.9.0-DEVELOPMENT (9363ac5) - pfsense.org
Custom host skips is_domain(). updatedns builds the cache path as /conf/dyndns_{if}{type} plus escapeshellarg($FQDN) plus {id}.cache. Quotes are filename bytes; / still splits the path. Content is IP|epoch, not a shell.
| ID | no CVE yet |
| Class | File write |
| Reach | Remote (authenticated WebGUI unless noted) |
| CWE | CWE-22 |
| CVSS | Medium: 5.4 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N |
| Product | pfSense CE |
| Affected | 2.9.0-DEVELOPMENT (9363ac5b8651a1c7a333180425ce7719070f95f9) |
| Auth | WebGUI session with page-services-dynamicdnsclient |
| 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:19270.
Series write-up: https://abraxaslabs.tech/research/pfsense-ce-leftovers
| Method | Sink | Privilege |
|---|---|---|
| POST services_dyndns_edit.php custom hostname with / | file_put_contents cache path using escapeshellarg($FQDN) | Integrity: Lab-proven: hostname with / wrote IP |
| same leftover | same sink | Recon: None. Content is IP |
| same leftover | same sink | Availability: Inferred: overwrite a file whose name matches the quoted suffix. |
Requires: page-services-dynamicdnsclient. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Requires: page-services-dynamicdnsclient. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Unauth. mwexec of FQDN. cron/php exec of *.cache. Non-Custom dyndns rejects that host.
No Diagnostics: Command unless that page is also granted.
cd lab
./run.sh
Loopback 127.0.0.1:19270. Compose project pfsense-dyndns-cache-path. Witness PFSENSE-DYNDNS-CACHE-PATH-WITNESS. Loopback only: 127.0.0.1:19270. Compose project pfsense-dyndns-cache-path. Witness PFSENSE-DYNDNS-CACHE-PATH-WITNESS. PHP gadget of the pinned lines. Stack tears down after the run.
Last line:
SUCCESS PFSENSE-DYNDNS-CACHE-PATH control-under-conf=yes trigger-outside-conf=yes PFSENSE-DYNDNS-CACHE-PATH-WITNESS
Do not use escapeshellarg as a filename. basename / is_domain the host.
9363ac5b8651a1c7a333180425ce7719070f95f9