/

CVE-2026-45788

Severity:

HIGH RISK

(7.5)

Information Exposure (CWE-200) in Discourse Uploads

CVE-2026-45788

Analyzed

Vulnerability type

Category:

Information Exposure

CWE:

CWE-200

Impact:

Exposure of Sensitive Information

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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_uploads site setting is enabled to guard file URLs, and
  • The pull_hotlinked_images setting 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_images logic 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.

Sources

SourceLink
github.comgithub.com/discourse/discourse/commit/5807c426880eadf248006e851604fc9284327ce5
github.comgithub.com/discourse/discourse/commit/8b4a959b251a856a9c911fb9f2ac34fbc31a7471
github.comgithub.com/discourse/discourse/commit/eff53af26367ae0dcb3a426954d233e8c7449f95
github.comgithub.com/discourse/discourse/commit/fa74e0dec7341a858ab83a1977fa52629bced1aa
github.comgithub.com/discourse/discourse/releases/tag/v2026.1.5
github.comgithub.com/discourse/discourse/releases/tag/v2026.4.2
github.comgithub.com/discourse/discourse/releases/tag/v2026.5.1
github.comgithub.com/discourse/discourse/releases/tag/v2026.6.0
github.comgithub.com/discourse/discourse/security/advisories/GHSA-3876-w96v-8v38

Frequently asked

questions

It can, under certain configurations. If secure uploads are intended to restrict access and the hotlink pulling process causes these files to be served in a less protected manner, users who were not originally authorized may gain access.

The attacker must know or obtain the exact secure upload URL and have a way to trigger pull_hotlinked_images processing on that URL, such as embedding it in content handled by Discourse. No deep system-level access is required, but knowledge of the URL is essential.

Ensure that any feature which reprocesses or rehosts URLs (hotlink importers, media pipelines, content filters) is fully aware of and enforces the authorization model for protected resources, so that secure assets cannot be downgraded to public ones solely through processing logic.

Design upload and content-processing subsystems around strict, centralized access-control checks; avoid relying on URL secrecy as a protection mechanism; and include privacy impact reviews when adding or modifying features that transform or cache user-provided URLs or files.

Find out what's already
exploitable in your codebase.