Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-52513 Overview
CVE-2024-52513 is an information disclosure vulnerability in Nextcloud Server and Nextcloud Enterprise Server. The flaw affects the Text app middleware, which failed to properly validate share permissions when attachments were referenced inside Text files. After receiving a "Files drop" or "Password protected" share link, a malicious user could download referenced attachments without supplying the required password. The issue is tracked under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Critical Impact
Unauthenticated recipients of a password-protected or Files drop share link can retrieve attachments referenced in Text documents, bypassing the intended password gate and leaking confidential files.
Affected Products
- Nextcloud Server versions prior to 28.0.11, 29.0.8, and 30.0.1
- Nextcloud Enterprise Server versions prior to 25.0.13.13, 26.0.13.9, 27.1.11.9, 28.0.11, 29.0.8, and 30.0.1
- Nextcloud Text app component (nextcloud/text)
Discovery Timeline
- 2024-11-15 - CVE-2024-52513 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-52513
Vulnerability Analysis
The vulnerability resides in the Nextcloud Text app, specifically in lib/Middleware/SessionMiddleware.php. The middleware did not verify the full share context before serving attachments embedded within a Text document. When a share link was gated by a password ("Password protected") or restricted to upload-only ("Files drop"), recipients were still able to request referenced attachment resources through the Text app endpoints. This allowed retrieval of file content that the share policy was supposed to protect behind authentication or a password challenge.
Root Cause
The root cause is a missing authorization check within the Text app's session middleware. The middleware authorized requests based on access to the Text document session without re-evaluating the originating share's permission constraints (such as Constants::PERMISSION_READ) or password-authenticated session state. Because the share details were not revalidated for each attachment fetch, the middleware treated the request as permitted even when the user had not satisfied the password prompt.
Attack Vector
Exploitation requires network access and user interaction with a crafted share link. An attacker who possesses a password-protected or Files drop share link, but not the password, requests the Text document and then invokes the attachment download endpoint. The middleware returns the referenced file content without enforcing the password check, disclosing confidential attachments.
// Patch excerpt: lib/Middleware/SessionMiddleware.php
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Middleware;
+use OCP\Constants;
use OCP\Files\IRootFolder;
use OCP\Files\NotPermittedException;
use OCP\IL10N;
use OCP\IRequest;
+use OCP\ISession;
use OCP\IUserSession;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager as ShareManager;
Source: Nextcloud Text commit ca24b25. The patch introduces Constants and ISession imports so the middleware can validate share permissions and the authenticated share session before returning attachment data.
Detection Methods for CVE-2024-52513
Indicators of Compromise
- Web server access logs showing attachment download requests under Text app endpoints without a preceding successful share password authentication.
- Repeated requests for the same share token targeting different attachment identifiers from a single client IP.
- Access to files_sharing or text endpoints referencing shares with password or fileDrop permission flags set.
Detection Strategies
- Review Nextcloud audit logs for attachment retrievals correlated against shares flagged as password-protected or Files drop.
- Compare Nextcloud Server and Text app versions across the fleet against the fixed releases listed in the GitHub Security Advisory GHSA-gxph-5m4j-pfmj.
- Hunt for anomalous external IPs issuing GET requests to Text document attachment endpoints without a prior POST to the share password handler.
Monitoring Recommendations
- Forward Nextcloud application and web server logs to a centralized analytics platform for continuous share-access monitoring.
- Alert on bulk attachment downloads originating from share tokens that have never completed password verification.
- Track upgrade compliance for both the core Nextcloud Server package and the bundled Text app.
How to Mitigate CVE-2024-52513
Immediate Actions Required
- Upgrade Nextcloud Server to version 28.0.11, 29.0.8, or 30.0.1.
- Upgrade Nextcloud Enterprise Server to 25.0.13.13, 26.0.13.9, 27.1.11.9, 28.0.11, 29.0.8, or 30.0.1.
- Audit existing password-protected and Files drop shares that contain Text documents with attachments and rotate any content considered sensitive.
Patch Information
The fix is implemented in the Nextcloud Text app via pull request #6485 and commit ca24b25c93b81626b4e457c260243edeab5f1548. The updated SessionMiddleware enforces share permission and session checks before serving attachment data. Full remediation details are published in the Nextcloud Security Advisory GHSA-gxph-5m4j-pfmj and the HackerOne Report #2376900.
Workarounds
- Disable or restrict the Nextcloud Text app until upgrading if password-protected shares are relied upon for confidentiality.
- Avoid embedding sensitive attachments in Text documents shared through Files drop or password-protected links until patched.
- Replace existing vulnerable share links with new shares after upgrading to invalidate any previously harvested tokens.
# Upgrade Nextcloud Server using the built-in updater
sudo -u www-data php /var/www/nextcloud/updater/updater.phar
# Verify installed version meets the fixed release
sudo -u www-data php /var/www/nextcloud/occ status
# Optionally disable the Text app as a temporary mitigation
sudo -u www-data php /var/www/nextcloud/occ app:disable text
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

