Closed Bug 1906425 Opened 1 year ago Closed 1 year ago

samesite=none cookies working even with secure=false

Categories

(Core :: Networking: Cookies, defect)

Firefox 127
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: bugs, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

Yesterday, one of our site broke on Chrome but not on Firefox. The authentication cookie had the samesite=none attribute (we’re doing weird things with iframes), but one incorrect change to our nginx configuration removed the secure attribute.

Actual results:

Chrome correctly rejected the authentication cookie ; Firefox incorrectly accepted it.

Expected results:

According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes :

If Secure is missing an error will be logged:

Cookie "myCookie" rejected because it has the "SameSite=None" attribute but is missing the "secure" attribute.

This Set-Cookie was blocked because it had the "SameSite=None" attribute but did not have the "Secure" attribute, which is required in order to use "SameSite=None".

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

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Component: Widget: Gtk → Networking: Cookies

Ed, could you take a look?
Thanks.

Flags: needinfo?(edgul)

Which version of firefox are you using? nightly, beta, release or ESR?

Only in nightly will the default network.cookie.sameSite.noneRequiresSecure pref be true. So, by default: beta, release and ESR will happily accept insecure samesite=none cookies. See: https://searchfox.org/mozilla-central/rev/6936c4c3fc9bee166912fce10104fbe0417d77d3/modules/libpref/init/StaticPrefList.yaml#11964

You can test that this is indeed the issue by going to about:config, setting the above pref to true and running your test scenario again. Does this fix the issue? If not, we may need to dig a little deeper.

Flags: needinfo?(edgul) → needinfo?(bugs)

Yes, I’m on release, I have the default value of false. My mistake, I thought it was already enabled on release.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Flags: needinfo?(bugs)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.