Inappropriate implementation in Network (CVE-2026-17818)
Duplicate Content-Disposition headers are coalesced into a comma-separated string, which fails token validation and defaults the disposition to inline. An attacker could make a response intended for download render as HTML and execute scripts in the host origin.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A potential vulnerability exists where duplicate Content-Disposition headers are coalesced into a single comma-separated string by GetNormalizedHeader. This coalesced value fails token validation inside the parser, defaulting the disposition type to inline and allowing files intended for download to render and execute scripts in the host origin's context.
Affected files:
content/browser/loader/download_utils_impl.cccomponents/download/internal/common/download_utils.ccios/web/navigation/crw_wk_navigation_handler.mmnet/http/http_content_disposition.ccnet/http/http_util.cc
Estimated timestamp from git blame: 2018-04-19
Description
A potential security bypass exists where duplicate Content-Disposition: attachment headers can cause Chromium to treat a forced download response as inline content, potentially leading to Cross-Site Scripting (XSS).
When the browser process receives multiple identical Content-Disposition headers, they are coalesced into a single comma-separated string by HttpResponseHeaders::GetNormalizedHeader because the "content-disposition" header is not classified as a non-coalescing header in net/http/http_util.cc. This results in the coalesced string value "attachment, attachment".
During parsing in HttpContentDisposition::ConsumeDispositionType (in net/http/http_content_disposition.cc), the presence of the comma character (,) causes the token check (HttpUtil::IsToken) to fail. Consequently, the parser fails to recognize the attachment directive, falls back to the default INLINE disposition type, and is_attachment() returns false.
Impacted Code Paths
-
Browser Process Navigation Gate: In
content/browser/loader/download_utils_impl.cc,MustDownloadretrieves the content-disposition header usingGetNormalizedHeader:C++ std::string disposition = headers->GetNormalizedHeader("content-disposition") .value_or(std::string());If duplicate headers are present, this returns
"attachment, attachment". When parsed,is_attachment()returnsfalse, causing the browser process to bypass the forced download logic. -
Blink Renderer Navigation Safety Assertions: In
third_party/blink/renderer/core/loader/frame_loader.cc(AssertCanNavigate), a safety assertion checks that the response is not an attachment:C++ CHECK(!IsContentDispositionAttachment( params->response.HttpHeaderField(http_names::kContentDisposition)));During response initialization in
WebURLResponse::Create, the renderer also coalesces duplicate header lines using commas (inResourceResponse::AddHttpHeaderField). Therefore, the stored header is also"attachment, attachment", which evaluates as non-attachment. The renderer does not crash on theCHECKand renders the response. -
iOS Navigation Handler: On iOS, the identical coalescing and parsing pattern is used in
ios/web/navigation/crw_wk_navigation_handler.mm(shouldRenderResponse:), leading to the same potential bypass.
Potential Reproduction Steps
Note: These steps are potential sequences based on static code analysis, as our tooling agent does not have the ability to run code.
-
Set up an HTTP/1.1 server that responds to a request with duplicate identical
Content-Dispositionheaders and user-controlled HTML:HTTP HTTP/1.1 200 OK Content-Type: text/html Content-Disposition: attachment Content-Disposition: attachment <script>alert(document.domain)</script> -
Navigate Chromium to this resource (e.g.,
http://example.com/uploads/evil.html). -
If the bypass is triggered, Chromium will render the HTML page inline instead of initiating a download, executing the script in the context of the host's origin.
Suggested Remediation
Add "content-disposition" to kNonCoalescingHeaders in net/http/http_util.cc. Since Content-Disposition is defined as a single-instance header under RFC 6266 and does not support comma-separated lists, coalescing should be explicitly disabled to prevent parsing failures.
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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.
How it worked
Root cause
Likely the header 'content-disposition' is not listed as non-coalescing, so duplicate headers are merged with a comma, causing the parser to reject the attachment token and fall back to inline.
Impact
If the bypass is triggered, an attacker could execute script in the host origin, but the report notes these are potential steps from static analysis and not yet confirmed by running code.
What the attacker needed
Attacker controls HTTP response headers; victim navigates to attacker-controlled URL
The fix
Add 'content-disposition' to the list of non-coalescing headers so duplicate headers are not merged.
How it was found
- Set up an HTTP server that returns duplicate Content-Disposition headers and HTML content.
- Navigate Chromium to the resource.
- Observe whether the HTML renders inline and executes script instead of downloading.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a website tells the browser to download a file instead of showing it, it uses a header called Content-Disposition. If that header appears twice, the browser joins them with a comma, which confuses the parser and makes it treat the file as a normal web page. That means a malicious file could run code in the context of the website.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.