Skip to content

Conversation

@tjementum
Copy link
Member

@tjementum tjementum commented Jan 13, 2026

Summary & Motivation

Add end-to-end tests for two session security scenarios: session revocation detection and replay attack detection. These tests verify that users are properly redirected to context-specific error pages with appropriate messaging when their sessions are compromised.

The tests simulate real-world security scenarios:

  • Session revoked from another browser shows "Session ended" message
  • Replay attack detection (stolen refresh token) shows "Security alert" message

Note: The security tests are skipped on Safari because WebKit does not allow programmatic manipulation of __Host_ prefixed cookies, which is required to simulate these attack scenarios. The tests run on Chromium and Firefox.

Also remove obsolete fallback logic in AuthenticationCookieMiddleware that added SessionNotFound header to all 401 responses. This fallback was originally added when the backend did not consistently set the x-unauthorized-reason header, but is no longer needed since commit 0b7fdc2 ensures all 401 responses include the header.

  • Add comprehensive E2E tests for session-revoked and replay-attack error pages with helper functions for cookie manipulation
  • Remove obsolete SessionNotFound fallback from AppGateway middleware
  • Update E2E tests to use button role instead of link role for error page navigation after commit bfb77c5

Checklist

  • I have added tests, or done manual regression tests
  • I have updated the documentation, if necessary

@tjementum tjementum self-assigned this Jan 13, 2026
@tjementum tjementum added the Bug Something isn't working label Jan 13, 2026
@linear
Copy link

linear bot commented Jan 13, 2026

@tjementum tjementum moved this to 🏗 In Progress in Kanban board Jan 13, 2026
@tjementum tjementum force-pushed the pp-764-e2e-tests-for-session-is-revoked branch from b2d63f1 to fd10fb6 Compare January 13, 2026 21:59
@sonarqubecloud
Copy link

@tjementum tjementum merged commit 8970f14 into main Jan 13, 2026
17 checks passed
@tjementum tjementum deleted the pp-764-e2e-tests-for-session-is-revoked branch January 13, 2026 23:02
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in Kanban board Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants