Repository navigation
fix: authenticate Visual Studio bridge - #3202
Open
Tal Zaccai (TalZaccai) wants to merge 6 commits into
Open
Tal Zaccai (TalZaccai) wants to merge 6 commits into
Tal Zaccai (TalZaccai) wants to merge 6 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Connection lifecycle failures and a clock-dependent regression fixture remain unresolved.
4 open issues
1 file not reviewed
ts/pnpm-lock.yaml: Generated file
What changed in this PR
Authenticates the bridge between TypeAgent and Visual Studio before trusting discovery results or dispatching IDE actions.
Changes:
- Adds protected per-user credentials and authenticated discovery.
- Adds session-based action authentication, replay protection, and response ownership checks.
- Adds regression tests, build wiring, and authentication documentation.
| File | Description |
|---|---|
| ts/pnpm-lock.yaml | Records new test dependencies. |
| ts/packages/utils/webSocketUtils/src/visualStudioBridgeAuth.ts | Implements credentials and authentication primitives. |
| ts/packages/utils/webSocketUtils/package.json | Exports authentication utilities. |
| ts/packages/shell/src/main/discoveryServer.ts | Protects shell discovery responses. |
| ts/packages/agentServer/server/src/connectionHandler.ts | Protects server discovery responses. |
| ts/packages/agentServer/protocol/src/protocol.ts | Adds discovery authentication contracts and hooks. |
| ts/packages/agentServer/protocol/src/index.ts | Exports discovery authentication types. |
| ts/packages/agents/visualStudio/tsconfig.json | Includes the test project. |
| ts/packages/agents/visualStudio/test/visualStudioBridgeAuth.spec.ts | Tests authentication and client routing. |
| ts/packages/agents/visualStudio/test/tsconfig.json | Configures test compilation. |
| ts/packages/agents/visualStudio/src/visualStudioActionHandler.ts | Authenticates clients and binds responses to sessions. |
| ts/packages/agents/visualStudio/src/originAllowlist.ts | Rejects explicit null origins. |
| ts/packages/agents/visualStudio/README.md | Documents authentication and overrides. |
| ts/packages/agents/visualStudio/package.json | Adds test scripts and dependencies. |
| dotnet/visualStudioTypeAgent/VisualStudioTypeAgent.csproj | Includes authentication sources and security reference. |
| dotnet/visualStudioTypeAgent/Bridge/DTEActionExecutor.cs | Implements the executor interface. |
| dotnet/visualStudioTypeAgent/Bridge/BridgeDiscovery.cs | Verifies discovery proofs before accepting ports. |
| dotnet/visualStudioTypeAgent/Bridge/BridgeAuthentication.cs | Implements credential validation and cryptographic framing. |
| dotnet/visualStudioTypeAgent/Bridge/AuthenticatedBridgeConnection.cs | Gates execution behind authenticated sessions. |
| dotnet/visualStudioTypeAgent/Bridge/AgentBridgeClient.cs | Uses authenticated discovery and connections. |
| dotnet/visualStudioTypeAgent.Tests/VisualStudioTypeAgent.Tests.csproj | Adds the C# regression harness. |
| dotnet/visualStudioTypeAgent.Tests/VisualStudioTypeAgent.BridgeCompile.csproj | Adds framework compatibility compilation. |
| dotnet/visualStudioTypeAgent.Tests/Program.cs | Tests proofs, replay rejection, and executor gating. |
| dotnet/visualStudioTypeAgent.Tests/BridgeCompileStubs.cs | Supplies isolated Visual Studio stubs. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sual-studio-bridge-auth
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Issue
The Visual Studio extension trusted an unauthenticated localhost discovery response and action WebSocket. A local impostor could substitute the bridge endpoint and dispatch arbitrary IDE actions, including named commands with attacker-controlled arguments.
Mitigating steps