Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-57155 Overview
CVE-2026-57155 is a path traversal vulnerability in OPNsense, the FreeBSD-based firewall and routing platform. The flaw resides in the Firewall Alias GeoIP importer at src/opnsense/scripts/filter/lib/alias/geoip.py. The process_zip() and process_gzip() functions use an unvalidated CSV country_code value when constructing output filenames below /usr/local/share/GeoIP/alias. An authenticated user with Firewall Alias Edit privilege can supply an attacker-controlled GeoIP source URL. The archive's country code can traverse into another directory, writing attacker-controlled content as root. Chaining a crafted newsyslog fragment with the default hourly cron job yields root command execution. OPNsense fixed the issue in version 26.1.11.
Critical Impact
Authenticated attackers with Firewall Alias Edit privilege can achieve complete firewall compromise through root code execution via path traversal and newsyslog abuse.
Affected Products
- OPNsense versions prior to 26.1.11
- FreeBSD-based firewall and routing deployments using the GeoIP Alias importer
- Installations exposing Firewall Alias Edit privileges to non-administrative users
Discovery Timeline
- 2026-10-15 - CVE-2026-57155 published to the National Vulnerability Database
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2026-57155
Vulnerability Analysis
The vulnerability is a classic path traversal [CWE-22] in the OPNsense GeoIP alias import workflow. When OPNsense parses the locations CSV file from a user-configured GeoIP source URL, it extracts the ISO country code at parts[4] without validating length or character content. The code then uses that value to build output filenames in /usr/local/share/GeoIP/alias, appending -IPv4 or -IPv6 suffixes.
Because the country code is attacker-controlled, traversal sequences such as ../ allow the importer to write arbitrary files as root under existing directories. The scenario escalates to code execution by placing a crafted fragment into /usr/local/etc/newsyslog.conf.d/ and an oversized log file to trigger it. The default hourly newsyslog cron job, running as root, then executes attacker-defined commands during log rotation.
Root Cause
The root cause is missing input validation on the ISO country code field parsed from an untrusted CSV source. The original check only verified that the field had at least one character. ISO 3166-1 country codes are exactly two alphanumeric characters, but the code accepted arbitrary content including path separators and traversal sequences.
Attack Vector
Exploitation requires an authenticated user with the Firewall Alias Edit privilege. The attacker configures a GeoIP alias pointing to a URL under their control. The server returns a locations CSV and archive whose country code field contains traversal sequences. The importer runs as root and writes the archive payload to the traversed location. A follow-up write of an oversized log file causes newsyslog to process the planted fragment and execute shell commands as root.
# Patch excerpt from src/opnsense/scripts/filter/lib/alias/geoip.py
for line in locations.decode().split('\n'):
parts = line.split(',')
if len(parts) > 4 and parts[0].isdigit():
- if len(parts[4]) >= 1:
+ if len(parts[4]) == 2 and parts[4].isalnum():
country_codes[parts[0]] = parts[4]
elif parts[2] == 'EU':
country_codes[parts[0]] = parts[2]
Source: GitHub Commit c46aced9. The patch enforces that the country code is exactly two alphanumeric characters, blocking traversal input at parse time.
Detection Methods for CVE-2026-57155
Indicators of Compromise
- Unexpected files written under /usr/local/share/GeoIP/alias or outside that directory with -IPv4 or -IPv6 suffixes
- New or modified fragments in /usr/local/etc/newsyslog.conf.d/ created by the GeoIP importer process
- GeoIP alias configurations referencing non-standard or externally hosted source URLs
- Oversized log files that trigger unexpected newsyslog rotations followed by root-owned process creation
Detection Strategies
- Audit OPNsense alias configurations for GeoIP sources that do not point to the official MaxMind or vendor-provided endpoints
- Monitor the OPNsense configd and cron logs for GeoIP import runs that write to paths outside /usr/local/share/GeoIP/alias
- Correlate hourly newsyslog cron executions with subsequent root process spawns of shells or interpreters
Monitoring Recommendations
- Enable file integrity monitoring on /usr/local/etc/newsyslog.conf.d/ and /usr/local/share/GeoIP/
- Forward OPNsense system and audit logs to a central SIEM for traversal-pattern analysis on alias import operations
- Alert on changes to the Firewall Alias Edit privilege assignments in the OPNsense user and group configuration
How to Mitigate CVE-2026-57155
Immediate Actions Required
- Upgrade OPNsense to version 26.1.11 or later without delay
- Review all accounts holding the Firewall Alias Edit privilege and remove it from users who do not require it
- Inspect existing GeoIP alias definitions and remove any pointing to untrusted or attacker-controllable URLs
- Audit /usr/local/etc/newsyslog.conf.d/ and /usr/local/share/GeoIP/alias for unauthorized files
Patch Information
The fix landed in OPNsense core via commits c46aced9 and e7fbfaa7, shipped in version 26.1.11. The patch validates that each ISO country code is exactly two alphanumeric characters before use in filename construction. See GitHub Security Advisory GHSA-wjqq-rfmm-v5h3 for the full advisory.
Workarounds
- Restrict the Firewall Alias Edit privilege to trusted administrators only until patching is complete
- Block outbound HTTP and HTTPS requests from the firewall to arbitrary hosts, allowing only vetted GeoIP providers
- Monitor and manually review any GeoIP alias source URL changes through configuration management
# Verify the OPNsense version and upgrade
opnsense-version
opnsense-update -ur
# Audit users holding Firewall Alias Edit privilege via the WebGUI:
# System > Access > Users and System > Access > Groups
# Inspect for unexpected newsyslog fragments
ls -la /usr/local/etc/newsyslog.conf.d/
find /usr/local/share/GeoIP -type f -name '*-IPv4' -o -name '*-IPv6'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

