Skip to content

Disable external process commands in remote (http)#1522

Open
anuchandy wants to merge 2 commits intomicrosoft:mainfrom
anuchandy:no-ext-process-remote
Open

Disable external process commands in remote (http)#1522
anuchandy wants to merge 2 commits intomicrosoft:mainfrom
anuchandy:no-ext-process-remote

Conversation

@anuchandy
Copy link
Member

@anuchandy anuchandy commented Jan 20, 2026

What does this PR do?

External process commands (like azqr) use IExternalProcessService to spawn local processes. In remote (HTTP) mode, this is a security risk: processes run under the server's host identity (not the OBO user's context), and malicious requests could exhaust server resources.

  • Add IsHttpMode() method to ServiceStartOptions
  • Conditionally exclude AzqrCommand registration in ExtensionSetup

Fixes #1521

[Any additional context, screenshots, or information that helps reviewers]

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@anuchandy anuchandy self-assigned this Jan 20, 2026
@anuchandy anuchandy requested a review from wbreza as a code owner January 20, 2026 02:45
Copilot AI review requested due to automatic review settings January 20, 2026 02:45
@anuchandy anuchandy requested review from a team and jongio as code owners January 20, 2026 02:45
@github-actions github-actions bot added the tools-Azd Azure Developer CLI related label Jan 20, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a security enhancement to disable external process commands (specifically azqr) when the MCP server is running in HTTP mode with On-Behalf-Of authentication. This prevents security risks where spawned processes would execute under the server's host identity rather than the user's context.

Changes:

  • Added IsHttpOnBehalfOfMode() helper method to ServiceStartOptions to detect HTTP + OBO mode
  • Implemented conditional registration logic in ExtensionSetup to exclude AzqrCommand in HTTP + OBO scenarios
  • Updated changelog to document the security enhancement

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
core/Azure.Mcp.Core/src/Areas/Server/Options/ServiceStartOptions.cs Adds helper method to detect HTTP + On-Behalf-Of mode
tools/Azure.Mcp.Tools.Extension/src/ExtensionSetup.cs Implements conditional registration to exclude azqr command in HTTP + OBO mode
servers/Azure.Mcp.Server/changelog-entries/1768876346795.yaml Documents the security feature addition

@anuchandy anuchandy added remote-mcp and removed tools-Azd Azure Developer CLI related labels Jan 20, 2026
@joshfree joshfree moved this from Untriaged to In Progress in Azure MCP Server Jan 20, 2026
@joshfree joshfree added this to the 2026-01 milestone Jan 20, 2026
@joshfree joshfree modified the milestones: 2026-01, 2026-02 Feb 3, 2026
@anuchandy anuchandy force-pushed the no-ext-process-remote branch from a1c8148 to fb57052 Compare February 25, 2026 20:58
@anuchandy anuchandy force-pushed the no-ext-process-remote branch from fb57052 to c6c5512 Compare February 25, 2026 21:35
@anuchandy anuchandy changed the title Disable external process commands in HTTP + On-Behalf-Of mode Disable external process commands in remote (http) Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[BUG] Block external process commands (that spawn az, azd, etc.) from being invoked in remote mode

5 participants