Insufficient validation of untrusted input in Dialog (CVE-2026-7998)
The browser-side handler that shows JavaScript alert, confirm and prompt dialogs did not check whether the calling frame was sandboxed without the allow-modals flag, so a compromised renderer could trigger modal dialogs from a sandboxed iframe. An attacker with renderer code execution could block the page with modals, phish through prompt, or steer user decisions through confirm.
- Fix shipped in 56 days
Report description
RenderFrameHostImpl::RunJavaScriptDialog() missing browser-side allow-modals sandbox flag check
Bug location
Where do you want to report your vulnerability?
Chrome VRP – Report security issues affecting the Chrome browser. See program rules
Which URL (or repository) have you found the vulnerability in?
The problem
Please describe the technical details of the vulnerability
This is a variant of issue 487471101 (allow-popups sandbox bypass). I am filing it separately since it affects a different IPC entrypoint (RunJavaScriptDialog vs CreateNewWindow) and requires its own fix, but I understand it may be considered part of the same effort tracked in issue 40607568. I leave it to the security team to decide whether this warrants a separate report or should be folded into the existing tracking bug.
RunJavaScriptDialog() does not check IsSandboxed(kModals) before showing alert(), confirm(), or prompt() dialogs. A compromised renderer in a sandboxed iframe (without allow-modals) can send RunModalAlertDialog/RunModalConfirmDialog/RunModalPromptDialog IPC directly and the browser shows the dialogs.
Vulnerable file: render_frame_host_impl.cc - RunJavaScriptDialog()
The renderer-side check in LocalDOMWindow::alert()/confirm()/prompt() blocks sandboxed calls, but the browser entrypoint has no corresponding check. Compare with the kPopups fix in CreateNewWindow() which checks IsSandboxed(kPopups) + ReceivedBadMessage.
Steps to reproduce:
- Check out stable tag:
git checkout 146.0.7680.32 git apply poc_patch.diff(removes renderer-side kModals checks to simulate compromised renderer)autoninja -C out/Default chrome- Start HTTP server:
python3 serve.py - Launch patched Chrome:
out/Default/Chromium.app/Contents/MacOS/Chromium --user-data-dir=/tmp/md1 http://127.0.0.1:8080/index.html- Observe:
alert(),confirm(), andprompt()dialogs appear from<iframe sandbox="allow-scripts">(noallow-modals). The iframe has opaque origin (null).
Bisect:
- Introducing commit:
15bee8d78bc8b- [email protected], May 22 2015. Addedallow-modalssandbox flag with renderer-only enforcement; browser-sideRunJavaScriptDialog()was never updated. - Variant gap widened by
a12e651f6f626(Feb 28, 2026) which added browser-side enforcement for kPopups but not kModals. - Affected: M44 through M146 (current stable).
Fix: Add IsSandboxed(kModals) check + ReceivedBadMessage in RunJavaScriptDialog(), matching the kPopups pattern in CreateNewWindow().
if (IsSandboxed(network::mojom::WebSandboxFlags::kModals)) {
bad_message::ReceivedBadMessage(
GetProcess(),
bad_message::RFH_MODAL_DIALOG_FROM_SANDBOXED_FRAME);
return;
}
Impact analysis
A compromised renderer in a cross-site sandboxed iframe (separate process via site isolation) can show modal dialogs that block the page, phish via prompt(), or manipulate user decisions via confirm(). Same class as bug 487471101 but lower impact since dialogs are less sensitive than popups.
The cause
What version of Chrome have you found the security issue in?
146.0.7680.32 (Stable)
Is the security issue related to a crash?
No, it is not related to a crash.
Choose the type of vulnerability
Site Isolation Bypass
How would you like to be publicly acknowledged for your report?
Tianyi Hu
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The browser-side RunJavaScriptDialog() entrypoint lacked the sandbox flag check that the renderer-side alert/confirm/prompt code performed, so the enforcement could be skipped by a compromised renderer.
Impact
A compromised renderer in a cross-site sandboxed iframe could show modal dialogs that block the page, phish via prompt, or manipulate user decisions via confirm, though the reporter rates this lower impact than the related popup bypass.
What the attacker needed
Compromised renderer process; cross-site sandboxed iframe without allow-modals
The fix
The browser-side dialog handler should check the modal sandbox flag and treat a violating message as a bad message, matching the existing popup fix.
How it was found
- Check out the stable tag 146.0.7680.32.
- Apply a patch that removes the renderer-side modal checks to simulate a compromised renderer.
- Build Chrome with autoninja.
- Start a local HTTP server serving the test page.
- Launch the patched Chrome against the test page and observe dialogs appearing from a sandboxed iframe without allow-modals.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A sandboxed iframe is a page embedded with restrictions, and one restriction (allow-modals) is meant to stop it opening pop-up style dialog boxes. The check for that restriction existed only inside the renderer process, which an attacker may control, and the browser process that actually draws the dialog never checked it. So a hijacked renderer could ask the browser to show dialogs that the sandbox should have blocked.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.