Files
tmail-flutter/web/logout-callback.html
T
Benoit TELLIERandClaude Opus 5.5 d86cad7baf fix(web): drop redirect_uri handling in logout-callback
logout-callback.html passed the redirect_uri query parameter straight to
window.location.replace(). A link in an email pointing to this page could
therefore navigate to a javascript: URL (script execution in the webmail
origin, with access to IndexedDB tokens) or act as an open redirect.

The application never sends redirect_uri: always go back to "/".
Also clear the OIDC transient keys from sessionStorage, where they live.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 10:17:14 +02:00

30 lines
901 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<script>
const AUTH_RESPONSE_KEY = "auth_info";
const CODE_VERIFIER_KEY = "auth_code_verifier";
window.onload = function () {
try {
sessionStorage.removeItem(AUTH_RESPONSE_KEY);
sessionStorage.removeItem(CODE_VERIFIER_KEY);
localStorage.removeItem(AUTH_RESPONSE_KEY);
localStorage.removeItem(CODE_VERIFIER_KEY);
// Never follow a caller-supplied redirect: an attacker-crafted
// link could otherwise navigate to a javascript: URL or a
// phishing page from the application origin.
window.location.replace("/");
} catch (error) {
console.error("[Logout Auth Redirect] Redirection failed:", error);
window.location.assign("/");
}
}
</script>
<title>Twake Mail</title>
</head>
<body>
</body>
</html>