Skip to content

[main] Cherry-pick MSRC fixes - #320659

Merged
Dileep Yavanmandha (dileepyavan) merged 5 commits into
mainfrom
Dileepy/msrc_cherrypick_main
Jun 9, 2026
Merged

Dileep Yavanmandha (dileepyavan) merged 5 commits into
mainfrom
Dileepy/msrc_cherrypick_main

Conversation

@dileepyavan

Copy link
Copy Markdown
Member

Cherry-picks from release/1.123 onto main:

Zhichao Li and others added 5 commits June 9, 2026 12:36
* [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)
(cherry picked from commit 4b6e246)
(cherry picked from commit 9fea92e)
* fix path traversal

* fix compilation

(cherry picked from commit 9b31ff8)
(cherry picked from commit a703741)
(cherry picked from commit 0f1ba1e)
(cherry picked from commit 5927baa)
Copilot AI review requested due to automatic review settings June 9, 2026 19:43
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Ladislau Szomoru (@lszomoru)

Matched files:

  • extensions/github/src/credentialProvider.ts

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.

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 isEqualOrParent handling 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")
@dileepyavan
Dileep Yavanmandha (dileepyavan) merged commit 7422e06 into main Jun 9, 2026
26 checks passed
@dileepyavan
Dileep Yavanmandha (dileepyavan) deleted the Dileepy/msrc_cherrypick_main branch June 9, 2026 21:26
@vs-code-engineering vs-code-engineering Bot added this to the 1.125.0 milestone Jun 9, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jul 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants