Skip to content

fix: do not resurrect destroyed or rotated sessions - #95

Merged
acoshift merged 3 commits into
masterfrom
security-fixes
Oct 26, 2026
Merged

acoshift merged 3 commits into
masterfrom
security-fixes

Conversation

@acoshift

Copy link
Copy Markdown
Member

Summary

  • Destroy is no longer written back by the middleware save. The response expires the cookie.
  • Regenerate stores only a destroyed marker, and Get will not adopt a record that contains that key.
  • Retry with MaxAttempts <= 0 performs the default three attempts instead of returning success without calling the inner store.
  • SQL Get returns a driver error instead of replacing it with a gob EOF.

Test plan

  • TestDestroyAfterChangeDoesNotRestore and TestDestroyWithResaveDoesNotRestore replay the original cookie through store.Memory
  • TestRegenerateDropsOldCookiePrivileges and TestDestroyedMarkerIsNotAdopted
  • TestRetrySuccess asserts three inner attempts when MaxAttempts is 0
  • TestSQLGetReturnsScanError requires context.Canceled, not io.EOF

Upgrade direct modules to current releases and tidy the graph.
go mod tidy rewrites the go line to 1.26.0 because redis v9.23.0
and golang.org/x/sys v0.49.0 declare go 1.26.0.
Retry with a zero MaxAttempts now uses its default of three attempts.
SQL Get returns the driver error instead of replacing it with gob EOF.
Destroy is not written back by the middleware save.
Regenerate keeps only a destroyed marker, which Get will not adopt.
Get must not adopt a stored record that contains the destroyed key,
including values a coder decoded as a non-int64 number.
Base automatically changed from update-deps to master October 26, 2026 07:33
@acoshift
acoshift merged commit f3a962d into master Oct 26, 2026
3 checks passed
@acoshift
acoshift deleted the security-fixes branch October 26, 2026 07:37
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.

1 participant