Skip to main content

OPNsense CVE-2025-13698

MEDIUM
Path Traversal (CWE-22)
2025-12-23 zdi-disclosures@trendmicro.com
4.5
CVSS 3.0 · Vendor: trendmicro
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate to adjacent OPNsense web GUI as admin
  2. Delivery
    Submit backup restore with traversal filename
  3. Exploit
    Bypass missing path validation in diag_backup.php
  4. Execution
    Write arbitrary file as root
  5. Impact
    Escalate to persistence or code execution

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires an authenticated, high-privilege (administrator-level) session on the OPNsense web GUI AND network-adjacent access to the management interface (AV:A), per the CVSS vector and description stating 'Authentication is required.' The specific trigger is the configuration backup/restore handler in diag_backup.php, where the user-supplied backup filename is not validated for path-traversal sequences before being used in file operations, allowing files to be created as root outside the intended /conf/backup (and RRD /var/db/rrd) directories. Limiting factors that reduce real-world risk: the attacker must already hold valid admin credentials or a hijacked admin session, must be on an adjacent network segment rather than the open internet, and no user interaction by a victim is needed (UI:N) but privileged access is the gating barrier.

Impact

Signals are consistent and point to a moderate, not urgent, priority. The CVSS 3.0 base score is 4.5 (Medium) with vector AV:A/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N: exploitation is constrained to a network-adjacent position and - critically - requires PR:H, meaning an already-authenticated high-privilege (administrative) user. EPSS is low at 0.61% (48th percentile), the CVE is NOT in CISA KEV, and no public POC is referenced, so exploitation status is 'no public exploit identified at time of analysis.' Mapped to an SSVC-style view: exploitation = none observed, automatable = no (requires valid admin authentication and adjacency), technical impact = total (files are created in the context of root, which can escalate to full compromise despite the base score only crediting I:H). The key tension is that the technical impact (arbitrary root-owned file creation, a realistic stepping stone to RCE/persistence) is far more severe than the 4.5 score suggests, but the preconditions (adjacent + admin auth) heavily gate real-world risk. This is a legitimate patch-and-move-on item for defense-in-depth against a rogue or compromised admin, not a drop-everything emergency.

Exploit ScenarioDerived

An authenticated administrator (or an attacker who has hijacked/obtained an admin session on the same management network segment) submits a crafted configuration backup restore via diag_backup.php where the filename contains directory-traversal sequences. Because the user-supplied path is not validated before the file operation, a file is written outside the intended backup directory in the root context, which can be used to drop or overwrite system files and pivot toward code execution. No public exploit code is identified at time of analysis, though the vendor fix commit is public and could aid reverse-engineering.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 19, 2026

A path-traversal flaw in Deciso OPNsense's diag_backup.php configuration backup/restore handler lets an administrator-level user supply a crafted backup filename that is used in file operations without validation, allowing arbitrary file creation with root privileges outside the intended /conf/backup and /var/db/rrd directories. The attack surface is limited: the CVSS vector (AV:A/PR:H/UI:N) and the vendor description both require a valid high-privilege web GUI session plus network-adjacent access to the management interface, so a remote unauthenticated attacker cannot reach it directly. Impact is integrity-only (no confidentiality or availability loss), EPSS is low at 0.61% (48th percentile), there is no CISA KEV listing, and no public exploit code has been identified at time of analysis; an upstream fix commit exists in the opnsense/core repository and ZDI tracks the issue as ZDI-25-1022 / ZDI-CAN-28133.

RemediationAI

Apply the upstream fix commit cb15c935137d05c86a1e6cf12af877e9c32a23af (https://github.com/opnsense/core/commit/cb15c935137d05c86a1e6cf12af877e9c32a23af) or upgrade to the OPNsense release that incorporates it - the patch adds basename() sanitization of backup filenames and replaces raw exec() calls with the shell_safe() helper, so no released version number can be cited from the available data and administrators should confirm against the vendor's changelog and the ZDI advisory (https://www.zerodayinitiative.com/advisories/ZDI-25-1022/) before assuming a given point release is clean. If immediate upgrade is not possible, restrict the web GUI and SSH management interfaces to a trusted management VLAN or explicit allow-list of admin hosts so that AV:A preconditions cannot be met from adjacent segments, and note this also blocks legitimate off-VLAN administration; remove or disable the RRD restore/import capability for non-essential accounts and enforce least privilege by not granting GUI administrator rights to routine operators, accepting that this does not remove the flaw for true admins; and terminate and rotate any administrator sessions that may have been hijacked, since a stolen admin session fully satisfies the PR:H precondition. Monitoring for unexpected files appearing outside /conf/backup and /var/db/rrd and for unusual rrdtool dump/restore invocations provides detection coverage but is not a substitute for patching.

Affected ProductsAI

Deciso OPNsense firewall/router distributions containing the pre-fix code in src/www/diag_backup.php and src/etc/inc/rrd.inc, specifically builds that still construct RRD restore paths as "/var/db/rrd/{$rrd['filename']}" and shell out to rrdtool via raw exec() rather than shell_safe(); no CPE strings or an exact affected/fixed release number were supplied in the source data, and the vendor advisory reference for this issue is ZDI-25-1022 at https://www.zerodayinitiative.com/advisories/ZDI-25-1022/ with the fix commit at https://github.com/opnsense/core/commit/cb15c935137d05c86a1e6cf12af877e9c32a23af. OPNsense installations deployed purely as a firewall with the GUI restricted to a dedicated management VLAN are affected in the same code path but far less exposed operationally.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

OPNsense is a FreeBSD-based firewall/router distribution whose web GUI is implemented in PHP; diag_backup.php handles backup download, restore and configuration operations executed as root. The vulnerability is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory / Path Traversal): a user-supplied backup filename from the restore path is concatenated directly into filesystem paths such as "/var/db/rrd/{$rrd['filename']}" and passed to shell commands invoking /usr/local/bin/rrdtool (dump and restore) without normalizing or rejecting '..' sequences. Because the PHP-FPM/GUI backend runs with elevated privilege, traversal out of the RRD directory yields file creation as root. The upstream commit cb15c935137d05c86a1e6cf12af877e9c32a23af addresses the root cause by wrapping filenames in basename() before path construction (e.g. "/var/db/rrd/" . basename($rrd['filename'])) and by replacing raw exec() calls with the shell_safe() quoting/argv helper for rrdtool dump/restore and the /usr/bin/du disk-usage call, closing both the traversal and the command-injection exposure that came from interpolating unquoted variables into shell strings. The CVSS vector AV:A/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N places the flaw at adjacent-network reachability with high privileges required and integrity-only impact.

Know when Opnsense gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (trendmicro) PRIMARY 4.5 MEDIUM
AV:A/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N
vuln.today AI 4.5 MEDIUM

Requires an authenticated admin session over the adjacent management network (PR:H, AV:A), with low complexity and no victim interaction; only integrity is affected via root-owned arbitrary file creation (I:H, C:N/A:N).

3.1 AV:A/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N
4.0 AV:A/AC:L/AT:N/PR:H/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (trendmicro).

CVSS VectorVendor: trendmicro

Attack Vector
Adjacent
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

DescriptionCVE.org

Deciso OPNsense diag_backup.php filename Directory Traversal Arbitrary File Creation Vulnerability. This vulnerability allows network-adjacent attackers to create arbitrary files on affected installations of Deciso OPNsense. Authentication is required to exploit this vulnerability.

The specific flaw exists within the handling of backup configuration files. The issue results from the lack of proper validation of a user-supplied path prior to using it in file operations. An attacker can leverage this vulnerability to create files in the context of root. Was ZDI-CAN-28133.

Threat Intelligence Overview

EPSS Score
0.6%
Top 52% exploitable
Prevalence
Medium
popular open-source firewall, common but not ubiquitous enterprise appliance
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.6%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Controlled
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

23
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +22
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

CVE-2023-39004 CRITICAL POC
9.8 Aug 09

Insecure permissions in the configuration directory (/conf/) of OPNsense Community Edition before 23.7 and Business Edit

CVE-2023-27152 CRITICAL POC
9.8 Oct 23

DECISO OPNsense 23.1 does not impose rate limits for authentication, allowing attackers to perform a brute-force attack

CVE-2023-39008 CRITICAL POC
9.8 Aug 09

A command injection vulnerability in the component /api/cron/settings/setJob/ of OPNsense Community Edition before 23.7

CVE-2023-39001 CRITICAL POC
9.8 Aug 09

A command injection vulnerability in the component diag_backup.php of OPNsense Community Edition before 23.7 and Busines

CVE-2023-39007 CRITICAL POC
9.6 Aug 09

/ui/cron/item/open in the Cron component of OPNsense Community Edition before 23.7 and Business Edition before 23.4.2 al

CVE-2023-39003 HIGH POC
7.5 Aug 09

OPNsense Community Edition before 23.7 and Business Edition before 23.4.2 was discovered to contain insecure permissions

CVE-2023-39005 HIGH POC
7.5 Aug 09

Insecure permissions exist for configd.socket in OPNsense Community Edition before 23.7 and Business Edition before 23.4

CVE-2023-38997 HIGH POC
7.2 Aug 09

A directory traversal vulnerability in the Captive Portal templates of OPNsense Community Edition before 23.7 and Busine

CVE-2023-38999 MEDIUM POC
6.5 Aug 09

A Cross-Site Request Forgery (CSRF) in the System Halt API (/system/halt) of OPNsense Community Edition before 23.7 and

CVE-2019-25373 MEDIUM POC
6.4 Feb 15

OPNsense 19.1 contains a stored cross-site scripting vulnerability that allows authenticated attackers to inject malicio

CVE-2019-25369 MEDIUM POC
6.4 Feb 15

OPNsense 19.1 contains a stored cross-site scripting vulnerability in the system_advanced_sysctl.php endpoint that allow

CVE-2019-25372 MEDIUM POC
6.1 Feb 15

OPNsense 19.1 contains a reflected cross-site scripting vulnerability that allows unauthenticated attackers to inject ma

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy