CVE-2026-42506
Medium · 6.1CVSS
6.1
EPSS
0.3%
Published
May 22, 2026
CISA due date
—
Cloudanix analysis
Some applications may accidentally turn specially crafted user content into code that runs in another user's browser.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Data Exposure
- Component
- Library
- Class
- XSS
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
This is a cross-site scripting weakness in Go's net-related HTML parsing/rendering flow where arbitrary HTML can be parsed into an unexpected document tree and then serialized with Render in a form that differs from what the application believed it had sanitized. Applications that sanitize user-supplied HTML before rendering may make security decisions on one structure while browsers interpret the final rendered output differently, allowing attacker-controlled markup, attributes, or scriptable elements to survive and execute in a victim's browser. The CVSS vector indicates network exploitability, low attack complexity, no required attacker privileges, required user interaction, and potential confidentiality and integrity impact across a changed browser security scope.
Why it matters to the business
Applications that accept and display user-generated HTML, comments, descriptions, profiles, messages, or rich-text content could unintentionally deliver attacker-controlled JavaScript to users. Successful exploitation can lead to account takeover, session theft where cookies or tokens are exposed, fraudulent actions performed as the victim, defacement, phishing inside a trusted application, or data exposure visible to the victim. The vulnerability is not currently listed in CISA KEV, has low EPSS, no known exploit maturity in the provided data, and no ransomware association, so broad active exploitation is not indicated; however, XSS issues in shared parsing libraries can have wide downstream impact wherever the vulnerable rendering pattern is used.
How an attack unfolds
An attacker identifies an application built with the affected Go net HTML functionality that accepts arbitrary or semi-trusted HTML and later renders it back to other users. The attacker crafts malformed or edge-case HTML that is interpreted one way by the application's sanitizer but transformed by the parser/rendering process into a different HTML tree. After Render serializes the content, the browser receives markup containing executable script behavior, such as dangerous event handlers, scriptable URLs, or namespace-based elements that bypassed the original checks. The attacker stores the payload in persistent content or sends it through a reflected input path. When a victim views the affected page, the browser executes the injected JavaScript in the context of the trusted application, enabling theft of accessible data, unauthorized user actions, phishing overlays, or session abuse depending on browser and application protections.
How to fix it
Upgrade the affected Go module/package as soon as an official fixed version is available from the Go project or the Go vulnerability database. No exact fixed version was provided in the input, so teams should monitor advisories for golang.org/x/net or the relevant Go net HTML component and pin to the first non-vulnerable release once published. As immediate mitigation, do not rely on parse-then-render behavior alone for sanitizing untrusted HTML. Use a mature allowlist-based HTML sanitizer that is explicitly safe for browser rendering, sanitize after any parsing or transformation step that can change the tree, and apply context-appropriate output encoding. Where rich HTML is not required, render user input as text rather than HTML. Add defense-in-depth controls such as a restrictive Content Security Policy that avoids unsafe-inline, HttpOnly and SameSite cookies, and separation of untrusted user content onto a distinct origin when practical.
How to confirm the fix worked
Inventory Go applications and dependencies for use of the affected Go net HTML parsing/rendering component, including direct and transitive references to golang.org/x/net. Use commands such as go list -m all and dependency scanners to identify versions in use, then compare them with the latest Go vulnerability database guidance. Review code paths that parse arbitrary HTML, sanitize it, and then call rendering/serialization functions before returning content to browsers. Confirm remediation by upgrading or applying mitigations, rebuilding and redeploying affected services, and running regression tests with malformed HTML payloads that previously produced unexpected rendered output. Validate browser-side behavior by confirming user-controlled HTML is either safely escaped, stripped to an allowlist, or rendered without executable attributes, scriptable URLs, or active content. Confirm CSP headers are present and block inline script execution where possible.
Typical attack path
- Find an application using Go's affected net HTML parsing/rendering behavior for user-supplied rich text or HTML.
- Submit crafted malformed HTML designed to cause a mismatch between the sanitized tree and the rendered/browser-interpreted tree.
- Have the application parse, sanitize, and render the content using the vulnerable workflow.
- Deliver the rendered content to a victim through stored content, shared links, messages, comments, or another user-facing page.
- Trigger JavaScript execution in the victim's browser under the trusted application's origin.
- Use the script execution to read accessible page data, perform actions as the victim, steal non-HttpOnly tokens, or present convincing phishing content.
How to detect it
Detection should focus on evidence of attempted or successful XSS payload delivery through inputs that accept HTML or rich text. Review web access logs, WAF logs, application request logs, API gateway logs, and stored user-generated content for encoded or raw HTML containing script tags, event-handler attributes, scriptable URI schemes, SVG/MathML payloads, malformed tag nesting, or unusual parser-confusion sequences. For stored-XSS scenarios, inspect database-backed content repositories, comments, profile fields, messages, tickets, descriptions, and CMS entries that are rendered to browsers. Browser execution evidence may appear as unusual outbound requests from users' browsers to attacker-controlled domains, reports from CSP violation endpoints, abnormal account actions immediately after viewing specific content, or spikes in requests containing document.cookie, localStorage, fetch, XMLHttpRequest, or beacon-style exfiltration patterns. Because this vulnerability does not define a single universal payload, the listed indicators are suspicious search terms rather than definitive proof of compromise and should be correlated with affected application code paths and user activity.
- <script
- </script>
- %3Cscript
- onerror=
- onload=
- onclick=
- onmouseover=
- javascript:
- data:text/html
- <svg
- %3Csvg
- <math
- %3Cmath
- <iframe
- %3Ciframe
- srcdoc=
- document.cookie
- localStorage
- sessionStorage
- XMLHttpRequest
- navigator.sendBeacon
- fetch(
- eval(
- alert(
- prompt(
- confirm(
- </style>
- </textarea>
- </title>
- xlink:href=
What your security team should do
- Identify internet-facing and user-facing Go applications that accept, store, transform, or display user-supplied HTML or rich text.
- Prioritize review of code paths using Go HTML parsing/rendering for sanitization or canonicalization decisions, especially where output is displayed to authenticated users or administrators.
- Monitor the Go vulnerability database and vendor advisories for an official fixed version, then upgrade and rebuild affected applications promptly.
- Until a fixed version is deployed, sanitize after all HTML parsing/transformation steps or render untrusted content as escaped text.
- Add or tighten Content Security Policy to reduce XSS impact, specifically avoiding unsafe-inline and restricting script-src to trusted sources.
- Review authentication cookies and tokens to ensure sensitive cookies are HttpOnly, Secure, and SameSite where compatible.
- Search recent access logs, application logs, and stored user-generated content for common XSS payload patterns and malformed HTML submitted to fields that render HTML.
- Add security regression tests for HTML sanitizer bypass cases so future parser or renderer changes do not reintroduce unsafe output.
The record
Parsing arbitrary HTML which is then rendered using Render can result in an unexpected HTML tree. This can be leveraged to execute XSS attacks in applications that attempt to sanitize input HTML before rendering.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| openSUSE:Leap 16.0 | grafana | 0 | 11.6.14+security04-bp160.2.1 |
| openSUSE:Leap 16.0 | mcphost | 0 | 0.34.0-160000.2.1 |
| openSUSE:Leap 16.0 | neonmodem | 0 | 1.0.7+git0.346d1d3-bp160.1.1 |
| openSUSE:Leap 16.0 | trivy | 0 | 0.71.0-160000.1.1 |
| openSUSE:Tumbleweed | grafana | 0 | 11.6.14+security04-3.1 |
| openSUSE:Tumbleweed | mcphost | 0 | 0.34.0-8.1 |
| openSUSE:Tumbleweed | rclone | 0 | 1.74.2-1.1 |
| openSUSE:Tumbleweed | trivy | 0 | 0.71.0-1.1 |
| openSUSE:Tumbleweed | velociraptor | 0 | 0.7.0.4.git185.a5708584-2.1 |
| openSUSE:Tumbleweed | yq | 0 | 4.53.2-2.1 |
Related vulnerabilities
- CVE-2026-27136 Parsing arbitrary HTML which is then rendered using Render can result in an unexpected… Also affects grafana
- CVE-2026-39821 The ToASCII and ToUnicode functions incorrectly accept Punycode-encoded labels that… Also affects grafana
- CVE-2026-42502 Parsing arbitrary HTML which is then rendered using Render can result in an unexpected… Also affects grafana
- CVE-2026-25681 Parsing arbitrary HTML which is then rendered using Render can result in an unexpected… Also affects grafana
- CVE-2026-25680 Parsing arbitrary HTML can consume excessive CPU time, possibly leading to denial of… Also affects grafana
- CVE-2026-28380 Any Editor could delete any snapshot, even if they have no access to read or write them. Also affects grafana
- CVE-2026-28383 A request to the Grafana plugin resources endpoint can cause unbounded memory allocation… Also affects grafana
- CVE-2026-33378 Using the $__timeGroup macro, one can achieve an OOM by overloading the server. Also affects grafana