Forums Bug Reports Thread

Banned window.confirm() shipped in friend-requests + blocked pages (duplicates the themed data-confirm modal)

Patrick Bass · Jun 6 · 9 · 1 Locked
[Major] [High Priority] [Bug Fixed] [Always Reproduces]
🚀 OP Jun 6, 2026 9:35pm

Area: Account (re-run) (audit p1r) · Surface: /friends/requests, /friends/blocked · Dimension: native-dialog · Severity: major

The Engineering Law bans native confirm()/alert()/prompt() (they break theme and look like malware). These two account/identity templates put data-confirm on the <form> element, which the global app.js handler and mobile-v2.js interceptor already turn into a themed App.modal.confirm. But each template ALSO registers a redundant inline submit handler that calls window.confirm() directly. The result is a banned native dialog (at minimum on keyboard-Enter submission, and a double-confirm risk) on the Cancel-friend-request and Unblock flows. Every other account/identity template (drafts, scheduled, rss, sessions, verification cancel, friends.php unfriend) correctly relies on the global data-confirm handler with no inline window.confirm.

Evidence

platform/templates/profile/friend-requests.php:146-152 and platform/templates/profile/blocked.php:63-69 both ship: `document.querySelectorAll('form[data-confirm]').forEach(function(f){ f.addEventListener('submit', function(e){ var m = f.getAttribute('data-confirm'); if (m && !window.confirm(m)) e.preventDefault(); }); });`. Meanwhile app.js:1367-1383 already binds a GLOBAL `[data-confirm]` click handler that calls `App.modal.confirm(...)`, and mobile-v2.js:94-96 has its own interceptor whose own comment says "never window.confirm — banned". So these two templates fire the BANNED native dialog (on Enter-key submit) on top of the themed modal.

Suggested fix. Delete the inline <script> blocks at friend-requests.php:146-153 and blocked.php:63-70 entirely. The global app.js [data-confirm] handler (and mobile-v2.js) already render the themed confirmation modal for these forms — no per-page script is needed.

Filed by the automated tenant-app audit and adversarially evidence-verified. Status: verified. Open — not yet actioned.


Patrick Bass
@mobieus

🚀 Jun 7, 2026 5:25am

Resolved — fixed and deployed. Commit dd336ac47616, shipped dev-first then to all tenants on 2026-06-06.

Deleted the inline <script> block (lines 146-153) that used the banned native window.confirm() on form[data-confirm]. The global app.js [data-confirm] handler already renders the themed confirmation modal, so the per-page script was redundant and policy-violating.

Status: fixed. Thread closed and locked.


Patrick Bass
@mobieus

Log in or register to reply to this thread.