Skip to content

[Problem/Bug]: DevTools remote debugging endpoint unreachable when WebView2 app runs elevated (v150 regression) #5640

Description

@emcepm

What happened?

Description

After the Evergreen WebView2 Runtime updated from 149.0.4022.98 to 150.0.4078.48, the DevTools remote debugging endpoint (http://127.0.0.1:<port>/json/version) is no longer reachable when the host application is started with administrator privileges.

This is a regression — the same application with the same configuration worked correctly on version 149 regardless of elevation level.

Suspected Cause

The WebView2 150 Prerelease SDK release notes list the following Runtime-only bug fix:

"Added trusted origin check during host object access."

This new security validation likely affects the loopback socket when the process runs at High Integrity Level, preventing the DevTools protocol server from accepting connections or binding the port.

Impact

  • Breaks all automated testing workflows (Selenium, Puppeteer, Playwright) for applications that require elevation
  • Breaks CDP-based monitoring and diagnostics for elevated enterprise applications
  • No workaround exists other than downgrading to v149 via Fixed Version runtime + BrowserExecutableFolder policy

Workaround

Currently using BrowserExecutableFolder policy to pin the application to WebView2 Fixed Version 149. This is not sustainable long-term.

Request

Please either:

  1. Revert or adjust the "trusted origin check" to allow loopback DevTools connections from elevated processes, or
  2. Provide a flag/policy to opt out of this behavior for development and testing scenarios.

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

150.0.4078.48

SDK Version

1.0.1722.32

Framework

Win32

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps

Steps to Reproduce

  1. Configure WebView2 with remote debugging enabled:
    WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=9222
    
  2. Launch the application without administrator privileges.
  3. Verify http://127.0.0.1:9222/json/version returns a valid JSON response. ✅
  4. Close the application.
  5. Launch the same application as administrator (Run as administrator).
  6. Attempt to reach http://127.0.0.1:9222/json/version. ❌ Connection refused.

Actual Behavior

When the application runs elevated (High Integrity Level), the DevTools endpoint does not listen or refuses connections. External tools (Selenium, Puppeteer, custom CDP clients) cannot attach to the WebView2 instance.

Error from Selenium:

RuntimeError: Edge driver initialization failed
Message: session not created: cannot connect to Microsoft Edge at localhost:9222

Expected Behavior

The DevTools endpoint should be reachable regardless of whether the host process is elevated, as it was in version 149 and all prior versions since at least v125.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Regression in newer Runtime

Last working version (if regression)

Runtime 149.0.4022.98

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingregressionSomething used to work but doesn't anymore

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions