DependencyTrack / DependencyTrack/dependency-track
Set SameSite attribute on session cookie created by the frontend
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
### Current Behavior
The frontend does not set any attributes on the session cookie. Since some time modern browser will treat such cookies as `strict` meaning that external links cannot use the cookie and hence you end up on the login page. This is annoying since links sent in mail notifications (and likely also Slack messages) won't work properly. Even if you log in the original link is lost therefore the only way is to copy and paste the link.
### Proposed Behavior
The session cookie should have `SameSite` set to `lax` which means that external links can use the session cookie. In case someone considers this as insecure this option could be configurable, e.g. letting the admin determine the value of `SameSite` via a configuration option.
### Checklist
- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this enhancement was already requested
Contributor guide
Assessment
This issue has not been assessed yet.