Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V50.2.1 (v4.0.3-3.4.1) - cookie secure attribute #2419

Closed
elarlang opened this issue Nov 29, 2024 · 6 comments
Closed

V50.2.1 (v4.0.3-3.4.1) - cookie secure attribute #2419

elarlang opened this issue Nov 29, 2024 · 6 comments
Labels
1) Discussion ongoing Issue is opened and assigned but no clear proposal yet 6) PR awaiting review V50 Group issues related to Web Frontend _5.0 - prep This needs to be addressed to prepare 5.0

Comments

@elarlang
Copy link
Collaborator

Current requirement, moved from V3.4.1 to V50.2.1 via #2410:

# Description L1 L2 L3 CWE
50.2.1 [MOVED FROM 3.4.1] Verify that cookie-based session tokens have the 'Secure' attribute set. 614

As the requirement is now a general cookie security requirement, the wording must be non-session-cookie specific.

Proposal:

Verify that cookies have the 'Secure' attribute set.

Level: keep level 1

@elarlang elarlang added _5.0 - prep This needs to be addressed to prepare 5.0 V50 Group issues related to Web Frontend labels Nov 29, 2024
@elarlang
Copy link
Collaborator Author

elarlang commented Nov 30, 2024

Proposal update based on #2422 (comment) + #2422 (comment)

Verify that cookies have the 'Secure' attribute set, and if the '__Host-' prefix is not used for the cookie name, the '__Secure-' prefix must be used for the cookie name.

The reasons:

  • Secure gives that browser is not allowed to send the cookie over http: connection
  • __Secure- gives that it is not possible to write a cookie with the same name without a Secure flag (including over http: connection)

@tghosth tghosth added the 1) Discussion ongoing Issue is opened and assigned but no clear proposal yet label Dec 2, 2024
@tghosth
Copy link
Collaborator

tghosth commented Dec 5, 2024

Does every cookie need this or only sensitive cookies?

@elarlang
Copy link
Collaborator Author

elarlang commented Dec 5, 2024

It is the same question as "does every HTTP request need to use HTTPS or only sensitive ones"?

If we require "everything must be over HTTPS" then there is no reason to allow cookies to be sent over http:.

The risk per cookie content is for sure different.

@Sjord
Copy link
Contributor

Sjord commented Dec 5, 2024

I suggest to make this requirement simply "all cookies must have the secure flag set", and then have a separate requirement for the cookie prefix.

@elarlang
Copy link
Collaborator Author

elarlang commented Dec 5, 2024

... and then have a separate requirement for the cookie prefix.

I prefer not, because:

  • __Secure- is related to Secure - both are for sending the message to the browser, that "cookies only over HTTPS"
  • __Secure- itself requires usage of Secure
  • __Secure- we can require only, if it is not valid to require __Host- to be used

@tghosth
Copy link
Collaborator

tghosth commented Dec 5, 2024

Verify that cookies have the 'Secure' attribute set, and if the '__Host-' prefix is not used for the cookie name, the '__Secure-' prefix must be used for the cookie name.

Agree with this wording, I agree that I don't want more requirements out of this :)

@elarlang elarlang added the 5) awaiting PR A proposal hs been accepted and reviewed and we are now waiting for a PR label Dec 5, 2024
@elarlang elarlang self-assigned this Dec 5, 2024
elarlang pushed a commit to elarlang/ASVS that referenced this issue Dec 5, 2024
@elarlang elarlang added 6) PR awaiting review and removed 5) awaiting PR A proposal hs been accepted and reviewed and we are now waiting for a PR labels Dec 5, 2024
@elarlang elarlang removed their assignment Dec 5, 2024
@elarlang elarlang closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1) Discussion ongoing Issue is opened and assigned but no clear proposal yet 6) PR awaiting review V50 Group issues related to Web Frontend _5.0 - prep This needs to be addressed to prepare 5.0
Projects
None yet
Development

No branches or pull requests

3 participants