/

CVE-2026-91123

Severity:

HIGH RISK

(7.2)

Path Traversal (CWE-22) in Discourse Iframe URL Guard

CVE-2026-91123

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Iframe Allowlist Bypass and Unauthorized Content Loading

Severity:

HIGH RISK

(7.2)

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 path traversal flaw in Discourse's iframe source validation can allow a crafted URL to pass an administrator-defined allowed subpath check. When the browser normalizes the URL, the iframe may load content from outside the permitted location, bypassing the intended embedding policy.

Affected context

The issue affects Discourse installations that use iframe source restrictions based on allowed subpaths. It becomes risky when an attacker can submit or influence iframe source values that are later rendered by the platform, and when validation interprets path separators differently from browser URL normalization.

Exploit preconditions

  • Attack surface: Discourse iframe source validation and rendering
  • Required access: The ability to submit or influence content containing an iframe source, subject to the site's posting and moderation permissions
  • Trigger point: Validation of a crafted iframe source before the browser resolves and normalizes its URL
  • Why exploitation is possible: The guard does not treat literal backslashes as path separators after decoded dot segments, allowing the checked path and browser-resolved path to differ

Why this happens

The vulnerability results from inconsistent path canonicalization between application-side validation and browser URL handling. After decoded dot segments are processed, the iframe guard fails to recognize literal backslashes as separators, so a source can appear to remain within an allowed subpath during validation while the browser resolves it outside that path. This is a path traversal issue mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Potential impact

  • An iframe may load content from a location the administrator did not authorize
  • Site embedding policies may be bypassed
  • Users could be exposed to untrusted or unexpected embedded content
  • The issue could increase the risk of follow-on client-side attacks if the loaded content is malicious

General mitigation guidance

Mitigation generally focuses on applying identical, canonical URL handling during validation and browser-facing rendering.

Common defensive patterns include:

  • Normalize and canonicalize URLs before applying allowlist comparisons
  • Treat equivalent separator and encoded traversal forms consistently
  • Compare structured URL components rather than raw strings
  • Use explicit origin and path allowlists with secure-by-default denial
  • Reduce trust in user-controlled iframe sources and restrict who can submit them
  • Apply least privilege and suitable browser isolation for embedded content

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules targeting path validation without canonicalization
  • Code review signals involving decoded dot segments, backslashes, URL parsing, and prefix-based allowlists
  • Differential tests that compare application validation with browser URL resolution
  • Policy enforcement requiring structured URL parsing and default-deny iframe source controls
  • Security tests covering encoded separators, traversal segments, and alternate URL representations

Automated review tools may help identify inconsistent normalization logic, but behavioral tests are important for confirming browser-facing results.

Sources

SourceLink
github.comgithub.com/discourse/discourse/commit/042d7b159beda4f74d23e245e8b2e396d9ff8318
github.comgithub.com/discourse/discourse/commit/097ce5600a2d74d9c68e57974597ab2684bd2a24
github.comgithub.com/discourse/discourse/commit/0b5a27e689925edce9ba9b14110022435d2b94be
github.comgithub.com/discourse/discourse/commit/142f5155ad8e56ddb8012c4e70c69a03dedc0579
github.comgithub.com/discourse/discourse/pull/42882
github.comgithub.com/discourse/discourse/security/advisories/GHSA-6pwj-wgg8-4rjc

Frequently asked

questions

It can be exploitable through normal Discourse content submission paths when an attacker is allowed to provide or influence iframe source values and those values are rendered by a vulnerable installation.

Access requirements depend on site configuration, including posting permissions, trust levels, moderation workflows, and whether untrusted content can reach iframe rendering.

Canonicalize iframe URLs consistently before validation, recognize equivalent path separators and traversal forms, and enforce a strict default-deny allowlist based on structured URL components.

Use browser-aligned URL parsing, test alternate encodings and separators, minimize user-controlled embed sources, and include path normalization checks in code review and automated security testing.

Find out what's already
exploitable in your codebase.