DependencyTrack / DependencyTrack/dependency-track

Set SameSite attribute on session cookie created by the frontend

Open
#2,985 1 comment 1 reaction 0 assignees View on GitHub
enhancement good first issue p3
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.