Summary
A sensitive information exposure issue in Discourse allows secure uploads to be unintentionally made public when the pull_hotlinked_images feature interacts with protected file URLs.
If an attacker already knows a secure upload URL while secure_uploads is enabled, the upload can be processed and exposed, leaking data that was intended to remain restricted.
Affected context
This vulnerability arises in Discourse instances that use secure uploads to protect access to files such as private attachments or restricted content.
It specifically affects configurations where:
- The
secure_uploadssite setting is enabled to guard file URLs, and - The
pull_hotlinked_imagessetting is active, allowing Discourse to fetch and rehost externally linked images and files.
Under these conditions, knowledge of a secure upload URL can cause Discourse to treat a protected asset like an external resource, bypassing the intended access controls.
Exploit preconditions
- Attack surface: Web application layer via Discourse post content and URL handling
- Required access: Ability to submit or otherwise cause Discourse to process a known secure upload URL (e.g., by embedding it in content)
- Trigger point: Invocation of
pull_hotlinked_imageslogic on content containing the secure upload URL - Why exploitation is possible: The mechanism that imports hotlinked resources does not consistently respect secure upload access controls, allowing a previously protected file to be re-served in a less restricted manner when its URL is known to the attacker.
Why this happens
The underlying bug class is information exposure through improper access control, mapped to CWE-200.
Discourse's secure upload feature aims to restrict direct file access, but the pull_hotlinked_images workflow treats URLs as generic external resources without fully honoring the secure upload protections.
This mismatch between content-processing logic and file authorization rules results in a state where knowledge of a secure upload URL is sufficient to transition that resource into a less protected context, exposing data that should remain confidential.
Potential impact
- Sensitive attachments that were intended to be private may be made publicly accessible.
- Confidential discussion assets (images, documents, logs) could be unintentionally leaked to unauthorized users.
- Regulatory or compliance risks can arise if protected personal or business data is exposed.
- Internal-only project or support materials may be accessible to external parties who learn the secure URLs.
General mitigation guidance
Mitigation patterns focus on ensuring that file handling logic consistently enforces confidentiality boundaries and does not bypass access control on the basis of URL knowledge alone.
Useful approaches include:
- Aligning content-processing features (such as hotlink pulling or image rebasing) with the same authorization checks used for secure uploads.
- Treating any URL to a protected resource as sensitive input that must never be re-hosted or transformed into a public asset without explicit authorization.
- Reducing the reliance on obscure or complex URLs as a security control; instead, enforce explicit permission checks prior to serving or reprocessing files.
- Segmenting storage and serving paths for secure uploads so that background jobs and import flows cannot inadvertently downgrade protection on restricted assets.
How teams detect issues like this
Detection generally involves reviewing how file URLs are processed and where secure upload logic interacts with content rewriting features.
Typical strategies include:
- Static analysis or manual code review to identify code paths where secure upload URLs are treated as generic external resources, especially around hotlinking or image pulling.
- Log analysis to detect unusual patterns in requests or internal resource fetching that involve secure upload paths, indicating potential exposure.
- Policy-based checks in CI or security review that ensure features which transform or rehost content (like hotlink importers) invoke consistent authorization and privacy controls.
- Automated scanning of application configuration to flag risky combinations of settings where sensitive uploads and aggressive content rewriting are enabled simultaneously.

