CVE-2026-57155: OPNsense: Root RCE via Arbitrary File Write in GeoIP Alias Importer
OPNsense is a FreeBSD based firewall and routing platform. Prior to version 26.1.11, the Firewall Alias GeoIP importer's processzip() and processgzip() paths in src/opnsense/scripts/filter/lib/alias/geoip.py use an unvalidated CSV countrycode value to construct output filenames below /usr/local/share/GeoIP/alias. A user with Firewall Alias Edit privilege can configure an attacker-controlled GeoIP source URL and supply an archive whose country code traverses into another existing directory, causing attacker-controlled content to be written as root with an -IPv4 or -IPv6 suffix. A crafted newsyslog fragment and oversized log file can use the default hourly root cron job to execute commands as root, resulting in complete firewall compromise. This issue is fixed in version 26.1.11.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
OPNsenseto a version that resolves this vulnerability.Fixed in 26.1.11
Event History
Frequently Asked Questions
Who can exploit this issue?
An authenticated user with the Firewall Alias Edit privilege can exploit it. The user must be able to configure a GeoIP source URL under their control and provide a crafted ZIP or GZIP archive.
Are default installations exposed to root command execution?
The described escalation uses the default hourly root cron job that runs newsyslog. Exploitation also requires the Firewall Alias Edit privilege and a writable path reachable through the GeoIP importer's filename traversal.
What is the impact if exploitation succeeds?
An attacker can write attacker-controlled content as root and leverage newsyslog processing to execute commands as root. This results in complete compromise of the firewall.
What should be done if upgrading is not immediately possible?
Restrict Firewall Alias Edit privilege to trusted administrators and do not configure GeoIP alias sources from attacker-controlled URLs. Review existing GeoIP alias source configurations for untrusted sources.
How can I determine whether the affected code is present?
OPNsense versions prior to 26.1.11 are affected. The vulnerable functionality is in the GeoIP alias importer's process_zip() and process_gzip() paths.