GHSA-fq94-cxvc-9r7w: OPNsense: Configuration line injection via multiple GUI text fields
OPNsense core through 26.7.8 contains a configuration injection vulnerability that allows authenticated users to append ntpd.conf directives by embedding newlines in the fudge and refid fields. Attackers holding the page-services-ntp-gps or PPS privilege can submit CR/LF characters via servicesntpdgps.php or servicesntpdpps.php to inject directives loaded by ntpd running as root.
Other sources
OPNsense is a FreeBSD based firewall and routing platform. Prior to 26.1.11 and 26.4.1p1, authenticated Web UI or API users with delegated access to affected settings can submit CR or LF characters in fields expected to contain one line, causing generated privileged service configuration files to contain additional attacker-controlled directives or policy lines. The confirmed Dnsmasq path includes dhcpboot.filename, dhcpboot.servername, dhcpboot.address, and dhcpoptions.value, which are rendered into /usr/local/etc/dnsmasq.conf; access through page-services-dnsforwarder covers api/dnsmasq/. Related affected fields span OpenVPN, DHCPv6, Unbound, IPsec, NTP, PPP or MPD, Monit, firewall, sudo, WebGUI, and System General configuration. Applying or restarting the affected service can alter behavior beyond the delegated setting, create service-side files, cross RBAC boundaries, or cause denial of service. Line injection through Monit mail password and adjacent Monit text fields into /usr/local/etc/monitrc demonstrated root command execution. Arbitrary shell command execution was not confirmed for the Dnsmasq path. This issue is fixed in versions 26.1.11 and 26.4.1p1.
— OSV
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
OPNsense coreto a version that resolves this vulnerability.Fixed in 26.1.11 - Upgrade
Upgrade
OPNsense coreto a version that resolves this vulnerability.Fixed in 26.4.1p1
Event History
Frequently Asked Questions
Which users can exploit this issue?
An attacker needs an authenticated Web UI or API account with delegated access to the affected configuration settings. For the NTP paths, the relevant privileges are page-services-ntp-gps or PPS privilege; the Dnsmasq API paths are covered by page-services-dnsforwarder.
What must an attacker do for injected directives to take effect?
The attacker submits CR or LF characters in configuration fields intended to contain a single line, then applies or restarts the affected service. The generated configuration can then contain attacker-controlled directives, and the NTP daemon is described as running as root.
Is the exposure limited to NTP GPS and PPS settings?
No. Confirmed Dnsmasq fields include dhcp_boot.filename, dhcp_boot.servername, dhcp_boot.address, and dhcp_options.value, which are rendered into dnsmasq.conf. Related affected fields span OpenVPN, DHCPv6, Unbound, IPsec, NTP, PPP or MPD, Monit, firewall, sudo, WebGUI, and System General configuration.