Bug 272741 - Mobile WebKit does not trigger downloads for lone \n in headers
Summary: Mobile WebKit does not trigger downloads for lone \n in headers
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari 17
Hardware: Unspecified iOS 17
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2024-04-16 04:21 PDT by jannis.rautenstrauch
Modified: 2024-04-23 04:22 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jannis.rautenstrauch 2024-04-16 04:21:23 PDT
Responses with a single erroneous \n|LF in their header lines trigger a download in WebKit Desktop (and in Firefox, Chromium).
In WebKit Mobile the response is instead displayed as a plain text file. Depending on where the LF occurs, headers before it even have effect (e.g., COOP).

I would expect the same behavior on mobile and desktop.


Response 1, COOP is active on WebKit mobile: http://sub.headers.websec.saarland/_hp/tests/window-references-coop.sub.html?resp_type=parsing&browser_id=1&label=COOP&first_id=23990&last_id=23990&scheme=http&t_resp_id=23990&t_element_relation=direct_direct&t_resp_origin=https://headers.webappsec.eu
```
HTTP/1.1 200
cross-origin-opener-policy: same-origin-allow-popups\n
more headers

body
```

Response 2, COOP is not active on WebKit mobile: http://sub.headers.websec.saarland/_hp/tests/window-references-coop.sub.html?resp_type=parsing&browser_id=1&label=COOP&first_id=22059&last_id=22059&scheme=http&t_resp_id=22059&t_element_relation=direct_direct&t_resp_origin=https://headers.webappsec.eu
```
HTTP/1.1 200
\ncross-origin-opener-policy: same-origin
more headers

body
```

Another question is whether the download dialog window should be "accessible", i.e., "window.open.opener" returns "window" (WebKit desktop, Chrome and Firefox on android), or whether it should be "null" (Chrome and Firefox on desktop).
Comment 1 Radar WebKit Bug Importer 2024-04-23 04:22:16 PDT
<rdar://problem/126913847>