# Text does not respect 'Allow download' permissions

Nextcloud Text app ignored share 'Allow download' restriction, letting a recipient embed shared images in a text file and fetch raw image bytes.

- Payout: $250
- Severity: low
- Program: Nextcloud
- Found by: rullzer
- Disclosed: 2023-08-23
- CVE: CVE-2023-39961
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1965156
- Library page: https://bugbountylibrary.com/r/h1%3A1965156
- Tags: area:web domain:web impact:data-leak kind:bounty platform:hackerone sev:low tech:php technique:source-review vuln:access-control

**Target:** Nextcloud Text app AttachmentController image attachment endpoint
**Root cause:** The Text app's attachment controller served image attachments without checking the share's 'Allow download' permission, only validating that the user had access to the file.
**Steps:**
1. user0 shares a folder of sensitive images with user1 with 'Allow download' disabled
2. user1 creates a new text file and inserts/embeds the shared images into it
3. user1 requests the raw image via the Text attachment endpoint (`AttachmentController.php` L57-67) and receives the image bytes
**How found:** Reporter noticed that inserting shared images into a Text file rendered previews and that the attachment controller served raw images, implying the download restriction was not enforced on that path.
**Exploitation:** Recipient of a download-restricted share embeds the shared images in a Text document, then requests the raw attachment endpoint to retrieve full image content despite the restriction.
**Insight:** When a share has a download restriction, audit every secondary renderer/attachment endpoint (preview, editor, thumbnail, export) that resolves the same file — the restriction is often enforced only on the primary download route.

