Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Problem/Bug]: BrowserProcess crashes with exit code -2147483645 when canceling the FrameNavigationStarting event (for a particular site) #4843

Open
pushkin- opened this issue Oct 2, 2024 · 1 comment
Assignees
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@pushkin-
Copy link

pushkin- commented Oct 2, 2024

What happened?

When canceling the FrameNavigationStarting event of certain sites, the browser process crashes. Exit code: -2147483645

{121715B2-ADD8-4CEA-B971-6A3915EC826D}

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

129.0.2792.65

SDK Version

1.0.2535.41

Framework

Winforms

Operating System

Windows 11

OS Version

22631.4169

Repro steps

modify the WinForms sample webview2 app as follows:

  1. Iin WebView2Control_CoreWebView2InitializationCompleted, add: this.webView2Control.CoreWebView2.NewWindowRequested += CoreWebView2_NewWindowRequested;
  2. make that handler create the webview2 itself and add a FrameNavigationStarting handler:
	private async void CoreWebView2_NewWindowRequested(object sender, CoreWebView2NewWindowRequestedEventArgs e)
	{
		e.Handled = true;
		using (e.GetDeferral())
		{
			Form form = new Form();
			WebView2 webView = new WebView2();
			await webView.EnsureCoreWebView2Async();
			form.Controls.Add(webView);

			webView.CoreWebView2.FrameNavigationStarting += CoreWebView2_FrameNavigationStarting;
			form.Visible = true;
			webView.Dock = DockStyle.Fill;
			e.NewWindow = webView.CoreWebView2;
		}
	}
  1. set the FrameNavigationStarting handler to:
	private void CoreWebView2_FrameNavigationStarting(object sender, CoreWebView2NavigationStartingEventArgs e)
	{
		if (e.Uri.StartsWith("https://smartscreentestratings.com/xplt_100_0_0.html"))
		{
			e.Cancel = true;
		}
	}
  1. start app and navigate to https://demo.smartscreen.msft.net/
  2. scroll down and click the Malvertising link (which will open a window to https://demo.smartscreen.msft.net/other/exploit_frame.html)
  3. observe browser process crashes

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

AB#54319772

@pushkin- pushkin- added the bug Something isn't working label Oct 2, 2024
@LiangTheDev LiangTheDev added the tracked We are tracking this work internally. label Oct 8, 2024
@LiangTheDev
Copy link
Member

Thanks for reporting the issue. I've filed an internal work item to track and investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

2 participants