Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

sameSite cookie support #16543

Closed
1 of 3 tasks
arkadiyt opened this issue Apr 30, 2018 · 4 comments
Closed
1 of 3 tasks

sameSite cookie support #16543

arkadiyt opened this issue Apr 30, 2018 · 4 comments

Comments

@arkadiyt
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • other

Current behavior:

Right now the angular cookie options support setting domain, expiration, and secure flags, but do not support the sameSite flag.

Expected / new behavior:

I'd like to request that support be added for the sameSite flag - this would help protect against CSRF attacks using cookies created by angular.

Minimal reproduction of the problem with instructions:

N/A

AngularJS version: 1.6.11

Browser: [Chrome >= 63 | Firefox >= 60 | Mobile Chrome >= 64]

Pulled via https://caniuse.com/#search=samesite

Anything else:

@petebacondarwin
Copy link
Contributor

@petebacondarwin
Copy link
Contributor

This seems like a reasonable request. I would say that changes need to go here: https://github.com/angular/angular.js/blob/master/src/ngCookies/cookieWriter.js#L35
With the new option being documented appropriate throughout the ngCookies module.

@gkalpak
Copy link
Member

gkalpak commented May 1, 2018

I am a little sceptical, since this is still experimental, there doesn't seem to be an up-to-date spec (only a draft that has expired since 2016) and is only implemented by Chrome (since 2016) and soon Firefox (currently in Firefox beta). This means that users can't really rely on it for protection (since several "mainstream" browsers will ignore it). Using CSRF tokens is a much better/more reliable way of protecting your app against CSRF attacks (afaict).

We should at least point it out in the docs.

m-amr added a commit to m-amr/angular.js that referenced this issue May 1, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 1, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 4, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 4, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 4, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 4, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 4, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 14, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 14, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 14, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 16, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 16, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue May 17, 2018
@arkadiyt
Copy link
Author

arkadiyt commented May 17, 2018

Thanks so much for getting this merged!

is only implemented by Chrome (since 2016) and soon Firefox (currently in Firefox beta)

Edge has also announced support now: https://twitter.com/MSEdgeDev/status/997145602474430464

Narretz pushed a commit to Narretz/angular.js that referenced this issue May 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants