☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-13698

CVE-2025-13698 Directory Traversal in Deciso
📅 PUBLISHED: 2025-12-23 21:40 UTC 🔄 UPDATED: 2026-09-23 20:35 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.61%
👁️
0.61% probability
15.3× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
4.5
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-13698 is a directory traversal vulnerability in Deciso OPNsense, specifically within the diag_backup.php script. This flaw allows an authenticated attacker with network-adjacent access to create arbitrary files on the target system by manipulating the filename parameter during a backup configuration operation. The vulnerability is rooted in insufficient validation of user-supplied paths before they are used in file operations. Successful exploitation could lead to the creation of files with root privileges, potentially enabling privilege escalation, persistence, or further compromise of the OPNsense firewall appliance.

The vulnerability has a CVSS v3.1 base score of 4.5 (Medium), with a vector of AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N. The attack vector is Adjacent Network, meaning the attacker must be on the same network segment as the target. Authentication is required, but the impact on integrity is high, as arbitrary files can be created. No public proof-of-concept (PoC) or exploit code has been released, and the EPSS score is 0.0%, indicating a very low probability of exploitation in the wild at this time.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is not related to a package manager (NPM, PyPI, Go, Ruby) but is a core component of the OPNsense web interface. The risk is primarily to organizations using OPNsense as their firewall or router, where an attacker with network access and valid credentials could compromise the integrity of the system.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
  • Base Score: 4.5 (Medium)
  • Attack Vector (AV): Adjacent Network (A) – The attacker must be on the same network segment (e.g., LAN, VPN).
  • Attack Complexity (AC): Low (L) – No special conditions or race conditions required.
  • Privileges Required (PR): Low (L) – Valid user credentials are needed.
  • User Interaction (UI): None (N) – No user action required beyond the attacker's own actions.
  • Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
  • Confidentiality (C): None (N) – No data exposure.
  • Integrity (I): High (H) – Arbitrary file creation can overwrite critical system files.
  • Availability (A): None (N) – No direct impact on availability.

Threat Level: Medium. While the CVSS score is moderate, the ability to create files as root is a significant integrity risk. An attacker could plant malicious scripts, modify configuration files, or establish persistence. The requirement for authentication and adjacent network access reduces the immediate threat but does not eliminate it, especially in environments where multiple users have access to the OPNsense web GUI.

Deep Dive & Mechanics

The vulnerability resides in the diag_backup.php script, which is part of the OPNsense web interface used for creating and downloading backup configuration files. The script accepts a user-supplied filename parameter to specify the name of the backup file. Due to insufficient validation, an attacker can include directory traversal sequences (e.g., ../) in the filename parameter.

Mechanism:

  1. The attacker authenticates to the OPNsense web GUI.
  2. The attacker sends a crafted HTTP request to /diag_backup.php with a manipulated filename parameter, such as filename=../../etc/cron.d/malicious.
  3. The script uses this path directly in file operations (e.g., fopen(), file_put_contents()) without sanitizing or canonicalizing the path.
  4. The backup content (which can be controlled by the attacker through other means, such as modifying configuration data) is written to the specified location.
  5. The file is created with root privileges, as the web server runs with elevated permissions.

Root Cause: The lack of proper validation of the user-supplied path before using it in file operations. The application should have used a whitelist of allowed filenames or sanitized the path to prevent directory traversal.

Vulnerable vs. Patched Code

Vulnerable Code (Conceptual PHP):

<?php
// diag_backup.php - vulnerable version
$filename = $_GET['filename'];
$backup_data = generate_backup(); // function that creates backup content
file_put_contents("/var/backups/" . $filename, $backup_data);
?>

Patched Code (Conceptual PHP):

<?php
// diag_backup.php - patched version
$filename = basename($_GET['filename']); // Strip directory components
$allowed_extensions = ['xml', 'conf', 'txt'];
$ext = pathinfo($filename, PATHINFO_EXTENSION);
if (!in_array($ext, $allowed_extensions)) {
    die("Invalid file extension.");
}
$backup_data = generate_backup();
file_put_contents("/var/backups/" . $filename, $backup_data);
?>

Explanation: The patched code uses basename() to remove any directory traversal components, ensuring only the filename is used. Additionally, it validates the file extension against a whitelist. The vulnerable code directly concatenates the user input into the path, allowing traversal.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • Network access to the OPNsense web interface (port 443 or 80).
  • Valid user credentials (e.g., admin:opnsense).

Exploitation Steps:

  1. Authenticate to the OPNsense web GUI.
  2. Craft a request to create a file in a sensitive location, such as /etc/cron.d/ for persistence.
  3. Use a tool like curl to send the malicious request.

Example curl command:

curl -k -X POST \
  -c cookies.txt -b cookies.txt \
  -d "filename=../../etc/cron.d/malicious&backup_data=* * * * * root /tmp/backdoor.sh" \
  "https://192.168.1.1/diag_backup.php"

Note: The exact parameter names and request format may vary. The attacker would need to analyze the actual HTTP request format of the backup functionality. The above is a conceptual example.

Alternative Approach: If the backup content is not directly controllable, the attacker could first modify a configuration setting (e.g., a firewall rule description) to contain malicious content, then trigger the backup to write that content to a target file.

Blue Team (Detection & Defense)

Detection:

  • Monitor web server logs for unusual diag_backup.php requests with directory traversal patterns (e.g., ../).
  • Alert on file creation events in sensitive directories (e.g., /etc/cron.d/, /usr/local/etc/, /root/).
  • Use file integrity monitoring (FIM) to detect unauthorized file changes.

Defense:

  • Apply the principle of least privilege to the web server process.
  • Implement a Web Application Firewall (WAF) rule to block directory traversal attempts.
  • Restrict access to the OPNsense web GUI to trusted IP addresses only.
  • Enforce strong authentication and consider multi-factor authentication (MFA).

Indicators of Compromise (IOCs)

Network IOCs:

  • HTTP requests to /diag_backup.php containing ../ or ..\\ in the filename parameter.
  • Unusual POST requests to /diag_backup.php with large or unexpected data.

File System IOCs:

  • Unexpected files in /etc/cron.d/, /usr/local/etc/, /root/, or other sensitive directories.
  • Files with unusual names or permissions (e.g., world-readable scripts in /etc/).
  • New files in /var/backups/ that do not match the expected naming convention.

Log IOCs:

  • Web server access logs showing diag_backup.php requests with directory traversal patterns.
  • System logs (e.g., /var/log/messages) indicating file creation events in protected directories.

Detection Engineering

YARA Rule

rule CVE_2025_13698_Directory_Traversal {
    meta:
        description = "Detects directory traversal attempts in OPNsense diag_backup.php"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-13698"
    strings:
        $traversal1 = "..\\" ascii wide
        $traversal2 = "../" ascii wide
        $traversal3 = "%2e%2e%2f" ascii wide
        $traversal4 = "%2e%2e\\" ascii wide
        $php_script = "diag_backup.php" ascii wide
    condition:
        $php_script and any of ($traversal*)
}

Sigma Rule

title: OPNsense diag_backup.php Directory Traversal Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects directory traversal attempts in OPNsense diag_backup.php requests
author: Valters IT
date: 2025-04-10
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2025-13698
logsource:
    category: webserver
    product: apache
    service: access
detection:
    selection:
        cs-method: 'POST'
        cs-uri-stem: '/diag_backup.php'
        cs-uri-query|contains: 
            - '..\\'
            - '../'
            - '%2e%2e%2f'
            - '%2e%2e\\'
    condition: selection
falsepositives:
    - Legitimate backup filenames containing dots (e.g., "backup.2025.04.10.xml")
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2025-13698 OPNsense diag_backup.php Directory Traversal Attempt";
    flow:to_server,established;
    content:"POST"; http_method;
    content:"/diag_backup.php"; http_uri;
    content:"filename"; http_client_body;
    pcre:"/(\.\.\/|\.\.\\|%2e%2e%2f|%2e%2e\\)/i";
    classtype:attempted-admin;
    sid:10000001;
    rev:1;
    reference:cve,2025-13698;
)

Remediation & Mitigation

Immediate Actions:

  1. Restrict Network Access: Limit access to the OPNsense web GUI to trusted IP addresses only. Use firewall rules to block access from untrusted networks.
  2. Enforce Strong Authentication: Ensure all user accounts have strong passwords. Consider implementing multi-factor authentication (MFA) if supported.
  3. Monitor Logs: Actively monitor web server and system logs for signs of exploitation.

Long-Term Fixes:

  1. Apply Vendor Patch: Monitor Deciso's official channels for a security update. Once available, apply the patch immediately.
  2. Implement WAF Rules: Deploy a Web Application Firewall (WAF) with rules to block directory traversal patterns.
  3. Code Hardening: If you have access to the source code, apply the patched code logic (using basename() and extension whitelisting) to diag_backup.php.
  4. File Integrity Monitoring: Deploy FIM tools to alert on unauthorized file creation in sensitive directories.

Workaround:

  • If patching is not immediately possible, consider disabling the backup functionality temporarily by removing or renaming the diag_backup.php file (e.g., mv /usr/local/www/diag_backup.php /usr/local/www/diag_backup.php.disabled). This will break legitimate backup functionality but will mitigate the vulnerability.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-13698/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.