Repository navigation
[main] Cherry-pick MSRC fixes - #320659
Merged
Dileep Yavanmandha (dileepyavan) merged 5 commits intoJun 9, 2026
Merged
Conversation
* [msrc/1.123] 114763 * Add maxAttributeSizeChars configuration to OpenTelemetry settings --------- Co-authored-by: Zhichao Li <[email protected]> (cherry picked from commit 042dc59) (cherry picked from commit be6ab8b)
…#46) A direct `<host>:<port>` remote authority (no resolver `+` prefix) bypasses resolver extensions and connects straight to the given server. Since this form can originate from untrusted sources (e.g. the `remoteAuthority` of a `.code-workspace` file), a crafted workspace could silently point the window's extension host backend at an attacker-controlled server. Centralize a confirmation prompt at the connection point in the renderer: when resolving a direct authority whose host is not loopback (localhost, 127.0.0.1, ::1), ask the user to confirm before connecting and abort if declined. Add `isLoopbackHost` helper and tests. (cherry picked from commit 9505d0f) (cherry picked from commit 9673132)
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ladislau Szomoru (@lszomoru)Matched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Cherry-picks multiple security- and reliability-focused fixes from release/1.123 onto main, spanning path traversal hardening for profile snippet import, safer direct remote authority connections, stricter GitHub host handling, and Copilot OpenTelemetry (OTel) visibility/consent UX.
Changes:
- Harden path handling: prevent snippet import keys from escaping the snippets directory; tighten
isEqualOrParenthandling around..normalization. - Add a confirmation prompt before connecting to direct
<host>:<port>remote authorities (non-loopback), and improve loopback detection. - Surface Copilot OTel state in the Chat UI via a dedicated status menu/toolbar surface and related styling/commands; restrict OTel configs in untrusted workspaces.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/userDataProfile/test/browser/snippetsResource.test.ts | Adds regression tests for snippet-import path traversal handling. |
| src/vs/workbench/services/userDataProfile/browser/userDataProfileInit.ts | Wires ILogService into SnippetsResourceInitializer. |
| src/vs/workbench/services/userDataProfile/browser/snippetsResource.ts | Adds bounded snippet key → resource resolution and warning logs on rejected keys. |
| src/vs/workbench/services/extensions/electron-browser/nativeExtensionService.ts | Prompts before connecting to direct remote <host>:<port> authorities and adds loopback gating. |
| src/vs/workbench/services/extensions/common/abstractExtensionService.ts | Makes _dialogService protected so subclasses can prompt. |
| src/vs/workbench/services/actions/common/menusExtensionPoint.ts | Registers new API menu key chat/input/status. |
| src/vs/workbench/contrib/chat/browser/widget/media/chat.css | Styles the new chat input status toolbar container + hover layout. |
| src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css | Refines chat input notification widget spacing/typography/rounding. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.ts | Implements a custom action view item + hover UI for chat input status contributions. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Hosts a non-overflowing MenuId.ChatInputStatus toolbar in the chat secondary toolbar. |
| src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.ts | Hides select entries (e.g. OTel) from the dashboard when surfaced elsewhere. |
| src/vs/sessions/contrib/chat/browser/newChatInput.ts | Adds the status indicators toolbar to the Sessions “new chat” view. |
| src/vs/sessions/contrib/chat/browser/media/chatWidget.css | Styles icon-only status items in the Sessions “new chat” view. |
| src/vs/platform/remote/test/common/remoteHosts.test.ts | Adds unit tests for isLoopbackHost. |
| src/vs/platform/remote/common/remoteHosts.ts | Adds isLoopbackHost helper for strict loopback detection. |
| src/vs/platform/agentHost/common/agentHostStarter.config.contribution.ts | Marks agent-host OTel settings as restricted. |
| src/vs/platform/actions/common/actions.ts | Introduces MenuId.ChatInputStatus. |
| src/vs/base/test/common/resources.test.ts | Adds a test covering isEqualOrParent with ../ normalization. |
| src/vs/base/common/resources.ts | Updates ExtUri.isEqualOrParent to force posix semantics via the new extpath API. |
| src/vs/base/common/extpath.ts | Updates isEqualOrParent to normalize when .. appears; changes API to forcePosixSemantics. |
| extensions/github/src/credentialProvider.ts | Tightens GitHub hostname matching (avoid evilgithub.com-style matches). |
| extensions/copilot/src/util/vs/base/common/resources.ts | Mirrors core ExtUri.isEqualOrParent change into vendored util copy. |
| extensions/copilot/src/util/vs/base/common/extpath.ts | Mirrors core isEqualOrParent normalization + API change into vendored util copy. |
| extensions/copilot/src/platform/otel/common/test/agentOTelEnv.spec.ts | Adds tests ensuring subprocess env isn’t forwarded in db-only mode. |
| extensions/copilot/src/platform/otel/common/agentOTelEnv.ts | Gates forwarded env vars on enabledExplicitly to prevent endpoint leakage to subprocesses. |
| extensions/copilot/src/extension/otel/vscode-node/otelContrib.ts | Adds OTel UI visibility (status item + pill), consent/dismiss flows, and terminal env mirroring. |
| extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLITerminalIntegration.ts | Always calls deriveCopilotCliOTelEnv (now internally gated by enabledExplicitly). |
| extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotcliSessionService.ts | Refactors OTel env mutation: snapshot/restore and avoid leaking endpoint when opted out. |
| extensions/copilot/package.nls.json | Adds localized text for untrusted workspace OTel configuration behavior. |
| extensions/copilot/package.json | Declares untrusted workspace restrictions and contributes OTel status commands + menu items. |
Copilot's findings
- Files reviewed: 30/30 changed files
- Comments generated: 3
Comment on lines
+61
to
+67
| test('apply ignores windows style path traversal keys', async () => { | ||
| const testObject = instantiationService.createInstance(SnippetsResource); | ||
| const escaped = joinPath(snippetsHome, '..', '..', '..', '..', 'tmp', 'PROBE_snippets'); | ||
|
|
||
| await testObject.apply(JSON.stringify({ snippets: { '..\\..\\..\\..\\tmp\\PROBE_snippets': 'ok' } }), profile); | ||
|
|
||
| assert.strictEqual(await fileService.exists(escaped), false); |
Comment on lines
+33
to
+38
| function toSnippetResource(extUri: IExtUri, snippetsHome: URI, key: string): URI | undefined { | ||
| const resource = extUri.joinPath(snippetsHome, key); | ||
| if (!extUri.isEqualOrParent(resource, snippetsHome) || extUri.isEqual(resource, snippetsHome)) { | ||
| return undefined; | ||
| } | ||
| return resource; |
Comment on lines
+308
to
+310
| message: nls.localize('remoteConnectionConfirm', "Allow connecting to the remote server '{0}:{1}'?", host, port), | ||
| detail: nls.localize('remoteConnectionConfirmDetail', "Code is about to connect to '{0}:{1}' to host a remote extension host. Only continue if you trust this server, as it will be able to run code and access files on your behalf.", host, port), | ||
| primaryButton: nls.localize('remoteConnectionConfirmButton', "Connect") |
Megan Rogge (meganrogge)
disabled auto-merge
June 9, 2026 20:31
Aaron Munger (amunger)
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-picks from
release/1.123ontomain: