mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
public/miniapp/redirect.html read the `url` query param and assigned it to both the manual <a href> and window.location.href with no validation. Served on the cabinet's own origin, this was an open redirect (phishing) and — in Telegram / WebView contexts that execute javascript: URIs in top-level navigation — a DOM-XSS able to exfiltrate the refresh_token from localStorage (account takeover). Add isSafeAppLink(): only a custom app deep link passes (scheme://, excluding http/https/file/blob/about/intent/content and the javascript/data/vbscript script schemes); anything else renders the no-URL state instead of navigating or setting href. Mirrors the validation already in src/pages/DeepLinkRedirect.tsx.