CVE-2026-27166
URL Manipulation via Insufficient iframe Cleanup in Discourse Codepen
Publication date: 2026-03-19
Last updated on: 2026-03-25
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| discourse | discourse | From 2026.1.0 (inc) to 2026.1.2 (exc) |
| discourse | discourse | From 2026.2.0 (inc) to 2026.2.1 (exc) |
| discourse | discourse | 2026.3.0 |
| discourse | discourse | to 2026.3.0 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-80 | The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
[{'type': 'paragraph', 'content': 'CVE-2026-27166 is a vulnerability in the Discourse open source discussion platform related to insufficient sanitization of iframe URLs, specifically for the default allowed iframe source Codepen.'}, {'type': 'paragraph', 'content': "The issue allows an attacker to embed iframes with URL-encoded path traversal sequences (like %2e%2e or %2E%2E representing '..') that bypass the sanitization checks. This enables the attacker to manipulate the iframe src attribute to perform path traversal attacks, potentially tricking users into changing the URL of the main page."}, {'type': 'paragraph', 'content': 'The vulnerability arises because the sanitization logic did not decode URL-encoded characters before checking for path traversal patterns, allowing encoded traversal sequences to bypass the checks.'}, {'type': 'paragraph', 'content': 'The issue has been fixed by decoding the iframe src URL before validation, blocking any iframe URLs containing path traversal sequences, and matching the decoded URL against an allowlist of permitted iframe sources.'}] [1, 2]
How can this vulnerability impact me? :
This vulnerability can impact you by allowing an attacker to perform HTML injection through manipulated iframe URLs, which can trick users into changing the URL of the main page.
The attack results in a scope change vulnerability where the integrity of the page is compromised, potentially misleading users or causing them to interact with malicious content.
The attack requires network access, low privileges, and user interaction, with low complexity, making it moderately feasible for attackers.
However, the vulnerability does not affect confidentiality or availability of the system.
A recommended workaround is to remove Codepen from the list of allowed iframes until the fixed versions are applied.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
[{'type': 'paragraph', 'content': 'This vulnerability involves insufficient sanitization of iframe src URLs in Discourse, specifically allowing URL-encoded path traversal sequences to bypass checks. Detection involves inspecting iframe src attributes for URL-encoded traversal patterns such as "%2e%2e" or "%2E%2E".'}, {'type': 'paragraph', 'content': 'You can detect attempts to exploit this vulnerability by monitoring web traffic or application logs for iframe URLs containing URL-encoded sequences representing ".." (e.g., %2e%2e).'}, {'type': 'list_item', 'content': 'Use network traffic inspection tools (e.g., Wireshark, tcpdump) with filters to identify iframe src URLs containing "%2e%2e" or "%2E%2E".'}, {'type': 'list_item', 'content': 'Search Discourse application logs or database entries for iframe src attributes with suspicious URL-encoded traversal sequences.'}, {'type': 'list_item', 'content': "Example command to search logs for encoded traversal sequences: grep -iE '%2e%2e|%2E%2E' /path/to/discourse/logs/*"}] [1]
What immediate steps should I take to mitigate this vulnerability?
To mitigate this vulnerability immediately, update Discourse to one of the patched versions: 2026.3.0-latest.1, 2026.2.1, or 2026.1.2.
If immediate patching is not possible, a recommended workaround is to remove Codepen from the list of allowed iframes in the Discourse configuration to prevent exploitation.
- Apply the security update that enhances iframe src sanitization by decoding URL-encoded characters before validation.
- Remove Codepen from the allowed iframe sources to block the attack vector.
- Monitor for suspicious iframe src URLs containing encoded path traversal sequences.