
pfSense CE 2.9.0-DEVELOPMENT - High - Remote - RCE - sshguard THRESHOLD CRLF
abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · pfsense-sshguard-crlf
Class: RCE Reach: Remote
pfSense CE 2.9.0-DEVELOPMENT (9363ac5) - pfsense.org
sshguard_threshold / blocktime / detection_time are not is_numericint. system_sshguard_start writes THRESHOLD= raw. Extra BACKEND= is the executable sshguard runs. Save restarts sshguard. Sibling class of SA-26_06, different file.
| 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-advanced-admin |
| 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:18950.
Series write-up: https://abraxaslabs.tech/research/pfsense-ce-leftovers
| Method | Sink | Privilege |
|---|---|---|
| POST system_advanced_admin.php sshguard_threshold | syslog.inc system_sshguard_start THRESHOLD= then sshguard BACKEND exec | Integrity: Lab-proven: extra BACKEND= last-wins; stub sourced sshguard.conf and exec'd that backend, which wrote the witness. |
| same leftover | same sink | Recon: Inferred: backend runs as root. |
| same leftover | same sink | Availability: Inferred: replace sshguard firewall backend. |
Requires: page-system-advanced-admin. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Requires: page-system-advanced-admin. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root. CSRF-magic on POST unless noted. WebGUI PHP-FPM is root.
Whitelist is is_subnet. SA-25_09 is a different sshguard bug.
No Diagnostics: Command unless that page is also granted.
cd lab
./run.sh
Loopback 127.0.0.1:18950. Compose project pfsense-sshguard-crlf. Witness PFSENSE-SSHGUARD-CRLF-WITNESS. Loopback only: 127.0.0.1:18950. Compose project pfsense-sshguard-crlf. Witness PFSENSE-SSHGUARD-CRLF-WITNESS. PHP gadget of the pinned lines. Stack tears down after the run.
Last line:
SUCCESS PFSENSE-SSHGUARD-CRLF control-single-backend=yes trigger-backend-exec=yes PFSENSE-SSHGUARD-CRLF-WITNESS
is_numericint the three sshguard fields. Reject CR/LF.
9363ac5b8651a1c7a333180425ce7719070f95f9