Skip to content

Refresh cookie on accessing v1/users/current #7729

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

Conversation

NamanMahor
Copy link
Contributor

@NamanMahor NamanMahor commented Aug 5, 2025

PLAT-120: Pentest: Implement definitive session timeout

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@NamanMahor NamanMahor changed the title Refresh cookie on accessing /v1/users/current Refresh cookie on accessing v1/users/current Aug 5, 2025
Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lastly, can you also:

  1. Check that this actually works? (E.g. by artificially reducing the cookie age to a lower time and testing it manually.)
  2. Check that replay attacks with the expired cookie is not possible? I.e. that the backend checks the cookie payload itself for expiration, so we don't just rely on browsers to enforce the expiration.

NamanMahor and others added 3 commits August 6, 2025 15:06
Co-authored-by: Benjamin Egelund-Müller <b@egelund-muller.com>
Co-authored-by: Benjamin Egelund-Müller <b@egelund-muller.com>
@NamanMahor
Copy link
Contributor Author

NamanMahor commented Aug 6, 2025

Lastly, can you also:

  1. Check that this actually works? (E.g. by artificially reducing the cookie age to a lower time and testing it manually.)

Yes it updating the cookie expire time on calling v1/user/current.

  1. Check that replay attacks with the expired cookie is not possible? I.e. that the backend checks the cookie payload itself for expiration, so we don't just rely on browsers to enforce the expiration.

403 error is coming when we try with expired cookie.

Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NamanMahor NamanMahor merged commit ee908ba into main Aug 7, 2025
10 checks passed
@NamanMahor NamanMahor deleted the namanmahor/plat-120-pentest-implement-definitive-session-timeout branch August 7, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants