mirror of
https://github.com/linagora/tmail-flutter.git
synced 2026-12-06 16:04:20 +00:00
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>
30 lines
901 B
HTML
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> |