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-2026-91123 Overview
CVE-2026-91123 is a path traversal vulnerability [CWE-22] in Discourse, an open-source discussion platform. The iframe src traversal guard failed to treat literal backslashes as path separators after decoded dot segments. A crafted iframe source could pass the allowed_iframes subpath check while browser URL normalization moved the loaded resource outside the administrator-approved path. The resulting iframe could load content from an unauthorized origin, undermining the embedded content policy configured by site administrators.
Critical Impact
Attackers can bypass the allowed_iframes subpath restriction and cause the Discourse frontend to embed content from locations the administrator never approved.
Affected Products
- Discourse versions prior to 2026.1.8
- Discourse versions prior to 2026.6.3
- Discourse versions prior to 2026.7.2 and 2026.8.0
Discovery Timeline
- 2026-09-24 - CVE CVE-2026-91123 published to NVD
- 2026-09-24 - Last updated in NVD database
Technical Details for CVE-2026-91123
Vulnerability Analysis
The flaw resides in the Discourse frontend sanitizer at frontend/pretty-text/addon/sanitizer.js. The traversal guard checked decoded iframe source URLs for dot-segment patterns using the regular expression /\/\.+\//. This pattern only matches forward slashes bounding the dot segments. Browsers, however, normalize backslashes (\) as path separators during URL resolution. An attacker could place ..\ or similar backslash-delimited traversal sequences inside the src value, pass the guard check against the allowed_iframes list, and let the browser normalize the final URL to a destination outside the permitted subpath.
Root Cause
The root cause is incomplete input validation of path traversal sequences. The guard assumed POSIX-style path separators and did not account for the backslash character, trailing path terminators (?, #), or end-of-string anchors. This mismatch between server-side allowlist validation and client-side URL normalization enables the bypass.
Attack Vector
Exploitation requires an attacker to supply a crafted iframe embed through content that renders via the Discourse sanitizer. No authentication or user interaction beyond viewing the rendered page is required. The vulnerability affects confidentiality and integrity of embedded content and crosses a trust boundary (scope changed).
// Source: https://github.com/discourse/discourse/commit/042d7b159beda4f74d23e245e8b2e396d9ff8318
// Security patch in frontend/pretty-text/addon/sanitizer.js
const iframeUrls = [decoded];
iframeUrls.push(value);
return (
- !decoded.match(/\/\.+\//) &&
+ !decoded.match(/\/\.+(?:[\/\\?#]|$)/) &&
allowedIframes.some((i) => {
const regex = i
// escape regex, keeping *
The fix broadens the dot-segment detection to also match when the segment is terminated by a backslash (\), query (?), fragment (#), or end-of-string, closing the normalization gap.
Detection Methods for CVE-2026-91123
Indicators of Compromise
- Rendered posts or themes containing <iframe> tags whose src includes backslash-delimited traversal sequences such as ..\ or mixed /..\ segments.
- Outbound browser requests from Discourse pages to hosts that are listed in allowed_iframes but resolve to paths outside the configured subpaths.
- Content Security Policy (CSP) frame-src violations referencing unexpected paths on allowed iframe hosts.
Detection Strategies
- Audit stored posts, themes, and plugins for iframe src values containing \, %5C, or dot segments adjacent to non-slash separators.
- Review web proxy and CDN logs for requests originating from Discourse-rendered pages that target unexpected subpaths on allowlisted iframe domains.
- Correlate Discourse application logs with browser-side CSP reports to identify embedded content loaded from unauthorized locations.
Monitoring Recommendations
- Enable and collect CSP report-uri or report-to data for the Discourse origin and alert on frame-src violations.
- Monitor the Discourse admin audit log for changes to the allowed_iframes site setting.
- Track upgrade status of Discourse hosts to confirm all instances are on a patched release.
How to Mitigate CVE-2026-91123
Immediate Actions Required
- Upgrade Discourse to version 2026.1.8, 2026.6.3, 2026.7.2, or 2026.8.0 depending on the maintained branch in use.
- Review the allowed_iframes site setting and remove any entries that are broader than strictly required.
- Scan existing posts and themes for iframe embeds containing backslashes or encoded traversal sequences and remove or rewrite them.
Patch Information
The fix is tracked in Discourse Security Advisory GHSA-6pwj-wgg8-4rjc and landed via Discourse Pull Request #42882. Backport commits are available at 042d7b1, 097ce56, 0b5a27e, and 142f515. All upgrade to a version at or above the fixed releases.
Workarounds
- Restrict the allowed_iframes site setting to the minimum set of exact host and subpath entries required for business functionality.
- Deploy a strict Content Security Policy that constrains frame-src to specific origins and paths, limiting the impact of a bypass.
- Where feasible, disable user-submitted iframe embeds entirely until the upgrade is applied.
# Configuration example: tighten allowed_iframes to specific subpaths
# From the Discourse Admin UI: Settings > Posting > allowed_iframes
# Replace broad entries like:
# https://example.com/
# with narrow, path-specific entries such as:
# https://example.com/embed/
# https://player.vimeo.com/video/
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

