Improper input validation in Editing (CVE-2026-78943)
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 months
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A logic flaw in Blink's HTML clipboard sanitization allowed for potential Universal Cross-Site Scripting (UXSS). The sanitizer filters script attributes before resolving relative URLs, enabling fragment-only references to resolve into executable 'javascript:' URLs after the filtering pass. This occurs when the clipboard's SourceURL is set to a malicious 'javascript:' payload.
Affected files:
third_party/blink/renderer/core/editing/serializers/serialization.ccthird_party/blink/renderer/core/dom/element.cccontent/browser/renderer_host/clipboard_host_impl.ccthird_party/blink/renderer/core/editing/commands/clipboard_commands.ccthird_party/blink/renderer/modules/clipboard/clipboard_reader.ccurl/url_canon_relative.cc
Estimated timestamp from git blame: 2020-07-13
Summary
A vulnerability in Blink's HTML clipboard sanitization logic potentially allows for Universal Cross-Site Scripting (UXSS). The issue arises from the order of operations in CreateFragmentFromMarkup, where scripting attributes are stripped before relative URLs are resolved against the clipboard's SourceURL (base URL). By providing a javascript: URL as the SourceURL and using fragment-only references (e.g., <a href="#x">) in the HTML markup, an attacker can bypass the script filter and inject live javascript: URLs into a victim's document upon pasting.
Root Cause Analysis
In third_party/blink/renderer/core/editing/serializers/serialization.cc, the function CreateFragmentFromMarkup() handles the parsing and sanitization of HTML fragments retrieved from the clipboard. The logic follows this sequence:
- Parse and Strip: It calls
fragment->ParseHTML()with a policy that disallows scripting content. This policy invokesStripScriptingAttributes, which checks if an attribute value is ajavascript:URL. At this stage, a relative value like"#x"is considered benign and is not stripped. - URL Resolution: After the initial parsing and filtering, it calls
CompleteURLs(*fragment, base_url). This function resolves all URL attributes against the providedbase_url(the clipboard'sSourceURL).
// third_party/blink/renderer/core/editing/serializers/serialization.cc
DocumentFragment* CreateFragmentFromMarkup(
Document& document, const String& markup, const String& base_url,
ParserContentPolicy parser_content_policy) {
...
fragment->ParseHTML(markup, fake_body, /*registry*/ nullptr,
parser_content_policy); // 1. Strips script attrs here
if (!base_url.empty() && base_url != BlankUrl() &&
base_url != document.BaseURL()) {
CompleteURLs(*fragment, base_url); // 2. Rewrites attrs AFTERWARDS
}
return fragment;
}
Chromium's URL resolver (in url/url_canon_relative.cc) allows bare-fragment references to resolve against any base, including non-hierarchical schemes like javascript:. For example, resolving "#x" against "javascript:alert(1)//" results in "javascript:alert(1)//#x".
Because CompleteURLs does not perform a post-resolution scheme check, it writes the resulting javascript: URL back into the attribute. The final sanitized fragment contains a live script link that was never inspected by the scripting attribute filter.
Potential Exploit Path
- Injection: A compromised renderer writes HTML to the clipboard with a malicious
SourceURL. For example:- Markup:
<a href="#x">Click me</a> - SourceURL:
javascript:alert(document.domain)//Note: These are suggested/potential steps; our tooling has not run this code.
- Markup:
- Paste: A user pastes this content into a victim site's
contenteditablearea.ClipboardCommands::GetFragmentFromClipboardretrieves the markup and the maliciousSourceURLas thebase_url. - Bypass: The sanitizer parses the markup. The
href="#x"passesStripScriptingAttributes. ThenCompleteURLsrewrites it tojavascript:alert(document.domain)//#x. - Execution: The malicious link is inserted into the victim origin. If the user clicks the link, the script executes in the context of the victim origin.
Impact
This bypass could allow cross-origin script execution (UXSS) whenever a user pastes content into a site that uses Blink's standard HTML sanitization (e.g., Webmail, document editors). It affects both the standard paste mechanism and the Async Clipboard API (navigator.clipboard.read()).
Suggested Fix
CompleteURLs should be updated to perform a scheme check after URL resolution. If a URL resolves to a javascript: scheme and the current policy disallows scripting content, the attribute should be sanitized or the change should be rejected.
Evaluated with Chrome root at commit: b3153093eb3c78c3e88ccf562bcbc20437a04b0e
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity XSS bug in Editing (Google Chrome). Chrome VRP made it public on 25 August 2026 as CVE-2026-78943. Fixed in version 152.0.7977.64.
About XSS
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.