Skip to content

webview: fix mixed-case remote resource authorities - #341488

Merged
Alex Ross (alexr00) merged 1 commit into
release/1.142from
alexr00/expensive-squid
Oct 14, 2026
Merged

Alex Ross (alexr00) merged 1 commit into
release/1.142from
alexr00/expensive-squid

Conversation

@alexr00

@alexr00 Alex Ross (alexr00) commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Fix blank webviews in remote windows whose authority contains uppercase letters, such as wsl+Ubuntu and wsl+FedoraLinux-44.

Webview resource URLs carry the remote authority in an HTTPS hostname, which the browser lowercases. The remote-OS lookup compared this normalized authority with the connection authority using strict equality, so it skipped the environment lookup and rejected otherwise valid resources with 401.

Use the existing case-insensitive authority comparison for that lookup. Target-OS-specific path normalization, resource-root containment, and rejection of different authorities or unknown remote operating systems remain unchanged.

Regression cause

Introduced by b0240f4c8e — Fix remote webview resource path containment, included in 1.141.1 and subsequently adopted on main in #341342. The introducing commit is absent from 1.141.0, and the known-good 1.140.0 loader has no remote-OS gate.

Fixed issues

Fixes #341396
Fixes #341398
Fixes #341431
Fixes #341423
Fixes #341451
Fixes #341458
Fixes #341473
Fixes #341474
Fixes #341421
Fixes #341440
Fixes #341444
Fixes #341461
Fixes #341469
Fixes #341475
Fixes #341482

Compare remote authorities case-insensitively when resolving the target OS, matching browser hostname normalization without weakening resource-root containment. Add resource-message regression tests for mixed-case WSL and SSH authorities and access-denied controls.

Fixes #341396\nFixes #341398\nFixes #341431\nFixes #341423\nFixes #341451\nFixes #341458\nFixes #341473\nFixes #341474

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 08:26
@alexr00 Alex Ross (alexr00) self-assigned this Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The targeted fix preserves security checks and has comprehensive regression coverage.

0 open findings

What changed in this PR

Fixes remote webview resource loading when browsers lowercase mixed-case remote authorities.

Changes:

  • Uses case-insensitive authority comparison before remote OS lookup.
  • Adds regression and authorization-boundary tests.
File Description
webviewElement.ts Compares remote authorities case-insensitively.
webviewElement.test.ts Tests mixed-case authorities and denial scenarios.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@alexr00
Alex Ross (alexr00) marked this pull request as ready for review October 14, 2026 09:08
@alexr00
Alex Ross (alexr00) merged commit d956e8a into release/1.142 Oct 14, 2026
51 checks passed
@alexr00
Alex Ross (alexr00) deleted the alexr00/expensive-squid branch October 14, 2026 09:52
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.0 milestone Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants