Closed Bug 2031299 Opened 3 months ago Closed 3 months ago

Request sent with "Cookie: " in inspector (with missing info bubble) and "Cookie: [object Object]" in Copy cURL; document.cookie is a string

Categories

(DevTools :: Netmonitor, defect)

Firefox 151
defect

Tracking

(firefox151 fixed)

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: nabijaczleweli, Assigned: baku)

References

Details

Attachments

(2 files)

Attached image 4d954ae6800f8daa[1].png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0

Steps to reproduce:

Clicked through a form on https://epit.podatki.gov.pl/. Same thing happens when just opening normally.

Actual results:

The site gave me

Bad Request - Request Too Long
HTTP Error 400. The size of the request headers is too long.

The inspector says "Cookie: " on a broken line (see attached); Copy cURL yields

curl 'https://epit.podatki.gov.pl/' \
  --compressed \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0' \
  -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
  -H 'Accept-Language: pl,en-GB;q=0.9,en;q=0.8,en-US;q=0.7' \
  -H 'Accept-Encoding: gzip, deflate, br, zstd' \
  -H 'Connection: keep-alive' \
  -H 'Cookie: [object Object]' \
  -H 'Upgrade-Insecure-Requests: 1' \
  -H 'Sec-Fetch-Dest: document' \
  -H 'Sec-Fetch-Mode: navigate' \
  -H 'Sec-Fetch-Site: none' \
  -H 'Priority: u=0, i' \
  -H 'TE: trailers'

I haven't found a way to bypass HSTS so I haven't seen what goes on the wire.

In the console, typeof document.cookie == "string", document.cookie.length == 9597. Visual inspection doesn't show anything interesting.

Expected results:

Nightly 151.0a1 (2026-04-10) (64-bit)

Summary: Request sent with "Cookie: " inspector (with missing info bubble) and "Cookie: [object Object]" in Copy cURL; document.cookie is a string → Request sent with "Cookie: " in inspector (with missing info bubble) and "Cookie: [object Object]" in Copy cURL; document.cookie is a string

The Bugbug bot thinks this bug should belong to the 'Core::Networking: Cookies' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking: Cookies
Product: Firefox → Core
Assignee: nobody → amarchesini
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Component: Networking: Cookies → Netmonitor
Product: Core → DevTools
See Also: → 2031585

Michael: The patch attached to this bug accidentally landed on elm earlier today https://hg-edge.mozilla.org/projects/elm/rev/fdc66c1b534aa7f67aad58d71278fe3a5f3b6855

I'm relanding it on autoland now, but what should we do about the elm revision. Should it be backed out there? Can it cause any issue?

Flags: needinfo?(mfroman)

I'll take care of it. Thank you for letting me know.

Flags: needinfo?(mfroman)
Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6bd724cdcfaa https://hg.mozilla.org/integration/autoland/rev/09eb75228c3b Fix DevTols cookie header serialization for long cookies, r=jdescottes,devtools-reviewers
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
QA Whiteboard: [qa-triage-done-c152/b151]
Duplicate of this bug: 2037536
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: