RocketChat / RocketChat/Rocket.Chat

Some cookies are misusing the recommended “SameSite“ attribute

Open
#28,387 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

After upgrading to 6.0.0 we're seeing the next trace in our browser console logs when we try to access the page:

     Cookie “rc_uid” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite
     Cookie “rc_token” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite
Steps to reproduce:
  1. Upgrade from 5.1.0 to 6.0.0
  2. Open the rocketchat url in a browser
  3. See error in the browser console logs
Expected behavior:

No error in the logs

Actual behavior:
Server Setup Information:
  • Version of Rocket.Chat Server: 6.0.0
  • Operating System: Ubuntu
  • Deployment Method: docker
  • Number of Running Instances: 1
  • DB Replicaset Oplog: Enabled
  • NodeJS Version: 14.21.2 - x64
  • MongoDB Version: 5.0.15
Client Setup Information
  • Desktop App or Browser Version: irrelevant
  • Operating System: irrelevant
Additional context
Relevant logs:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing where the rc_uid and rc_token cookies are set during the 5.1.0-to-6.0.0 upgrade; the report names no source files, tests, or entry points. Reproduce the browser console warning and verify that both cookies use a valid SameSite value without introducing authentication regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
authentication, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.