Back to Intelligence

CVE-2026-85885: Critical Command Injection in Microsoft 365 Copilot (CVSS 9.9) — Detection and Remediation Guide

SA
Security Arsenal Team
September 17, 2026
11 min read

NVD has published CVE-2026-85885, a CVSS 9.9 (Critical) vulnerability in Microsoft 365 Copilot — one of the most widely deployed AI assistants in enterprise environments. The flaw is classified as CWE-77: Improper Neutralization of Special Elements used in a Command (Command Injection), and per the advisory it allows an authorized attacker to elevate privileges over a network.

This is exactly the class of vulnerability that should get your immediate attention. M365 Copilot sits at the intersection of your identity plane, your data plane (SharePoint, OneDrive, Exchange, Teams), and increasingly your execution plane via Copilot Studio agents, plugins, and connectors. A command injection flaw in that fabric — reachable over the network, requiring only low-privilege authenticated access — is a direct path from "ordinary licensed user" to "elevated access across the tenant." With Copilot licensed across millions of enterprise seats, the blast radius here is measured in tenants, not endpoints.

Defenders need to act on three fronts right now: confirm Microsoft-side mitigation status for your tenant, tighten who can invoke Copilot and what it can reach, and deploy detection coverage for the post-exploitation behaviors that follow a successful privilege escalation.

Technical Analysis

Affected Component

  • Product: Microsoft 365 Copilot (cloud-hosted service; including Copilot experiences surfaced through the M365 app, Teams, Outlook, Word/Excel/PowerPoint integrations, and Copilot Studio-connected agents)
  • CVE: CVE-2026-85885
  • CVSS: 9.9 (Critical) — network attack vector, per NVD
  • Weakness: CWE-77 — Improper Neutralization of Special Elements used in a Command ('Command Injection')
  • Advisory: https://nvd.nist.gov/vuln/detail/CVE-2026-85885 (cross-reference the Microsoft Security Response Center entry linked from the NVD record for Microsoft's authoritative mitigation statement)

How the Vulnerability Works — Defender's View

Command injection in an LLM-backed assistant is particularly dangerous because Copilot is an orchestrator: it takes user (or document-sourced) input, grounds it against tenant data via Microsoft Graph, and dispatches actions through plugins, connectors, and declarative agents. An improper-neutralization flaw in that pipeline means specially crafted input — embedded in a prompt, a processed document, or a plugin/agent interaction — can cause the Copilot backend to execute injected commands or directives outside the caller's intended permission boundary.

The practical attack chain, from a defender's perspective:

  1. Access: Attacker holds a low-privilege, licensed account in the target tenant (the CVE requires authorization — think compromised standard user, contractor account, or an account purchased via access brokers).
  2. Injection: The attacker submits crafted input to M365 Copilot — directly via chat, or indirectly via content Copilot is induced to process (a technique family closely related to indirect prompt injection against Copilot that researchers demonstrated throughout 2025).
  3. Escalation: The injected command executes in an elevated backend context, allowing the attacker to perform actions or access data beyond their assigned privileges — the "elevate privileges over a network" outcome NVD describes.
  4. Post-exploitation: Typical follow-on behaviors include Microsoft Graph enumeration, mail/SharePoint collection, new app consent or service principal creation, and admin role assignment — all of which are observable in your logs even when the injection itself happens server-side.

Why the Server-Side Nature Matters

Because M365 Copilot is SaaS, you cannot patch the vulnerable code yourself — Microsoft's remediation happens in their service fabric. Your defensive surface is therefore:

  • Identity and access control (who can reach Copilot, from where, under what conditions)
  • Copilot configuration (plugin/agent permissions, Graph connector scope, SharePoint oversharing that Copilot amplifies)
  • Post-exploitation detection (the escalation has to land somewhere in your tenant — that's where you catch it)

Exploitation Status

At time of publication, check the NVD record and CISA KEV catalog for current status. Treat any KEV addition as an immediate escalation trigger — CISA KEV deadlines for federal agencies typically land within weeks, and that clock is a reasonable proxy for your own SLA given the 9.9 score and the low authentication bar. Assume motivated threat actors are reverse-engineering the injection pathway from the advisory language alone; CWE-77 against a high-value orchestration layer is a priority target for both red teams and real adversaries in 2026.

Detection & Response

The injection itself executes server-side, so endpoint rules alone won't catch it. What you can reliably detect: (a) anomalous Copilot interaction patterns in audit telemetry, (b) downstream command execution when Copilot-adjacent components touch endpoints, and (c) the privilege-escalation artifacts — role assignments, consent grants, and Graph enumeration — that make the attack worth carrying out.

Sigma Rules

YAML
---
title: Office Application Spawning Shell or Script Interpreter
description: Detects Microsoft Office or Copilot host processes spawning command shells or script interpreters, consistent with post-exploitation command execution following CVE-2026-85885-style injection or malicious content processed through M365 Copilot surfaces.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-85885
  - https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/04/06
id: 3f8a2c41-7b9e-4d15-a2c6-8e1f5b9d3a72
status: experimental
tags:
  - attack.execution
  - attack.t1059
logsource:
  category: process_creation
  product: windows
detection:
  selection_parent:
    ParentImage|endswith:
      - '\winword.exe'
      - '\excel.exe'
      - '\powerpnt.exe'
      - '\outlook.exe'
      - '\msteams.exe'
      - '\msteams.exe'
      - '\copilot.exe'
  selection_child:
    Image|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
      - '\pwsh.exe'
      - '\wscript.exe'
      - '\cscript.exe'
      - '\mshta.exe'
      - '\rundll32.exe'
  condition: selection_parent and selection_child
falsepositives:
  - Rare legitimate add-in behavior; tune per environment baseline
level: high
---
title: M365 Admin Role Assignment Outside Change Window
description: Detects directory role assignments in Entra ID audit telemetry, a common privilege-escalation artifact following exploitation of CVE-2026-85885 where an attacker elevates from an authorized low-privilege Copilot user.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-85885
  - https://attack.mitre.org/techniques/T1098/
author: Security Arsenal
date: 2026/04/06
id: 9c4d7e12-5a3b-4f86-b1d9-2e7c6a8f4b15
status: experimental
tags:
  - attack.persistence
  - attack.privilege_escalation
  - attack.t1098
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName:
      - 'Add member to role'
      - 'Add eligible member to role'
      - 'Add service principal to role'
  filter_known_admins:
    InitiatedBy|contains:
      - '@yourdomain.com'
  condition: selection and not filter_known_admins
falsepositives:
  - Legitimate IAM administration; scope the filter to your actual admin UPN suffixes and PIM workflows
level: high
---
title: Suspicious Application Consent Grant Following Copilot Session
description: Detects OAuth consent grants to applications, a persistence and data-access technique frequently chained after privilege escalation in M365 tenants, including scenarios involving CVE-2026-85885.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-85885
  - https://attack.mitre.org/techniques/T1550/
author: Security Arsenal
date: 2026/04/06
id: 61b3f8d4-2c7a-4e59-9d83-4f1a7c5e2b96
status: experimental
tags:
  - attack.persistence
  - attack.credential_access
  - attack.t1550.001
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName:
      - 'Consent to application'
      - 'Add app role assignment to service principal'
  selection_scope:
    TargetResources|contains:
      - 'Mail.Read'
      - 'Files.Read.All'
      - 'Sites.FullControl.All'
      - 'Directory.Read.All'
  condition: selection and selection_scope
falsepositives:
  - Approved enterprise app onboarding; maintain an allowlist of sanctioned app registrations
level: medium

KQL — Microsoft Sentinel / Defender

This hunt correlates Copilot interaction activity in the Unified Audit Log with downstream privilege-escalation artifacts from the same user within a tight window — the behavioral signature of an authorized user abusing CVE-2026-85885 to elevate.

KQL — Microsoft Sentinel / Defender
// Hunt: Copilot activity followed by privilege escalation artifacts (CVE-2026-85885)
let Window = 4h;
let CopilotUsers =
    OfficeActivity
    | where TimeGenerated > ago(24h)
    | where OfficeWorkload =~ "Copilot" or Operation has_any ("CopilotInteraction", "Copilot")
    | summarize CopilotActions = count(), FirstSeen = min(TimeGenerated) by UserId, ClientIP;
let EscalationEvents =
    AuditLogs
    | where TimeGenerated > ago(24h)
    | where OperationName has_any ("Add member to role", "Add eligible member to role", "Consent to application", "Add app role assignment to service principal", "Add service principal credentials")
    | extend ActorUPN = tostring(InitiatedBy.user.userPrincipalName)
    | extend TargetOps = OperationName;
CopilotUsers
| join kind=inner (EscalationEvents) on $left.UserId == $right.ActorUPN
| where TimeGenerated between (FirstSeen .. (FirstSeen + Window))
| project UserId, ClientIP, CopilotActions, FirstSeen, EscalationTime = TimeGenerated, TargetOps, ResultDescription
| sort by EscalationTime desc;
// Supplemental: burst of Graph/SharePoint access from a single user post-Copilot session
OfficeActivity
| where TimeGenerated > ago(24h)
| where OfficeWorkload in ("SharePoint", "OneDrive", "Exchange")
| summarize FileOps = count(), DistinctSites = dcount(SiteUrl) by UserId, ClientIP, bin(TimeGenerated, 1h)
| where FileOps > 200 or DistinctSites > 25
| sort by FileOps desc;

Velociraptor VQL

Endpoint-side hunt for Office/Teams/Copilot host processes that spawned interpreters — the local footprint if injected content or a Copilot-delivered payload triggers execution on a workstation.

VQL — Velociraptor
-- Hunt: M365 app processes spawning shells or script interpreters
SELECT Pid,
       Ppid,
       Name AS ProcessName,
       Exe AS ProcessPath,
       CommandLine,
       Username,
       CreateTime
FROM pslist()
WHERE Ppid IN (
    SELECT Pid
    FROM pslist()
    WHERE Name =~ '(?i)(winword|excel|powerpnt|outlook|msteams|copilot)\.exe$'
)
AND Name =~ '(?i)(cmd|powershell|pwsh|wscript|cscript|mshta|rundll32)\.exe$'

Remediation & Verification Script

Because the vulnerable code is Microsoft-hosted, your script work focuses on verifying tenant hygiene, confirming Copilot access scoping, and surfacing escalation artifacts for review.

PowerShell
# CVE-2026-85885 — M365 Copilot tenant hardening and exposure verification
# Requires: Microsoft.Graph PowerShell SDK (scopes: Directory.Read.All, RoleManagement.Read.Directory, AuditLog.Read.All)

# 1. Connect and confirm context
Connect-MgGraph -Scopes "Directory.Read.All","RoleManagement.Read.Directory","AuditLog.Read.All" -NoWelcome
$ctx = Get-MgContext
Write-Host "[+] Connected to tenant: $($ctx.TenantId)" -ForegroundColor Green

# 2. Enumerate Copilot license assignments — attack surface = licensed, authorized users
Write-Host "`n[*] Enumerating M365 Copilot license assignments..." -ForegroundColor Cyan
$copilotSku = Get-MgSubscribedSku -All | Where-Object { $_.SkuPartNumber -match "Copilot" }
foreach ($sku in $copilotSku) {
    Write-Host "    SKU: $($sku.SkuPartNumber) — Consumed: $($sku.ConsumedUnits)/$($sku.PrepaidUnits.Enabled)"
}

# 3. Review recent directory role assignments (last 7 days) — escalation artifact
Write-Host "`n[*] Reviewing directory role membership changes (last 7 days)..." -ForegroundColor Cyan
$since = (Get-Date).AddDays(-7).ToString("yyyy-MM-ddTHH:mm:ssZ")
$roleEvents = Get-MgAuditLogDirectoryAudit -Filter "activityDateTime ge $since" -All |
    Where-Object { $_.ActivityDisplayName -match "Add member to role|Add eligible member to role" }
if ($roleEvents) {
    $roleEvents | ForEach-Object {
        Write-Host "    [!] $($_.ActivityDateTime) | $($_.ActivityDisplayName) | Initiator: $($_.InitiatedBy.user.userPrincipalName)" -ForegroundColor Yellow
    }
    $roleEvents | Export-Csv -Path ".\RoleAssignment_Review_$(Get-Date -Format yyyyMMdd).csv" -NoTypeInformation
    Write-Host "    Exported to RoleAssignment_Review_$(Get-Date -Format yyyyMMdd).csv"
} else {
    Write-Host "    [+] No role assignment events in window."
}

# 4. Flag service principals with high-privilege Graph scopes granted recently
Write-Host "`n[*] Checking recent OAuth grants for high-privilege scopes..." -ForegroundColor Cyan
$grants = Get-MgAuditLogDirectoryAudit -Filter "activityDateTime ge $since" -All |
    Where-Object { $_.ActivityDisplayName -match "Consent to application" }
$grants | ForEach-Object {
    $scopes = ($_.TargetResources[0].modifiedProperties | Where-Object { $_.displayName -match "Consent" }).newValue
    if ($scopes -match "Mail.Read|Files.Read.All|Sites.FullControl|Directory.Read") {
        Write-Host "    [!] HIGH-PRIV CONSENT: $($_.ActivityDateTime) | $($_.InitiatedBy.user.userPrincipalName) | $scopes" -ForegroundColor Red
    }
}

# 5. Verify Unified Audit Log is enabled (required for Copilot interaction hunting)
Write-Host "`n[*] Verify Unified Audit Log status at: https://purview.microsoft.com/audit" -ForegroundColor Cyan
Write-Host "    Copilot interaction records (CopilotInteraction) must be retained for detection queries."

# 6. Restrict Copilot web-grounded chat and plugin scope pending Microsoft mitigation confirmation
Write-Host "`n[*] Recommended: review Copilot plugin/agent permissions at https://admin.microsoft.com > Copilot > Settings" -ForegroundColor Cyan
Write-Host "    - Disable non-essential third-party plugins and connectors"
Write-Host "    - Restrict Copilot Studio agent publishing to approved makers"
Write-Host "    - Apply Conditional Access requiring compliant devices for Copilot access"

Remediation

1. Confirm Microsoft's mitigation status for your tenant. M365 Copilot is serviced entirely by Microsoft; CVE fixes for SaaS components are deployed by the vendor without customer action. Pull the MSRC advisory linked from the NVD record (https://nvd.nist.gov/vuln/detail/CVE-2026-85885), confirm the fix deployment status, and open a support case referencing CVE-2026-85885 if your tenant shows any anomalous Copilot behavior. Document the vendor confirmation for your change and audit records — "Microsoft patched it" is a finding closure, not an assumption.

2. Shrink the authorized-user attack surface. The CVE requires an authorized attacker. Every licensed Copilot seat is a potential starting point:

  • Audit Copilot license assignments; remove licenses from inactive, service, and shared accounts.
  • Enforce phishing-resistant MFA (FIDO2/passkeys) and Conditional Access for all Copilot users — a 9.9 with an auth requirement means credential theft is the delivery mechanism.
  • Require compliant, managed devices for Copilot access via Conditional Access session controls.

3. Constrain what Copilot can reach and execute.

  • In the M365 admin center, disable third-party plugins and Graph connectors that aren't business-justified; every connector expands the command-injection blast radius.
  • Restrict Copilot Studio agent creation and publishing to an approved maker group; review existing declarative agents for excessive Graph permissions.
  • Address SharePoint/OneDrive oversharing — Copilot inherits user effective permissions, and post-escalation data access will exploit every "Everyone except external users" share you haven't cleaned up.

4. Verify detection coverage before you need it. Confirm Unified Audit Log ingestion into Sentinel, validate that Copilot interaction events are flowing, and deploy the Sigma/KQL content above. Run the hunt retroactively over at least the period since the CVE publication date — a 9.9 network-reachable flaw warrants a compromise-assessment pass, not just forward-looking detection.

5. Watch the KEV clock. If CISA adds CVE-2026-85885 to the Known Exploited Vulnerabilities catalog, federal agencies will face a binding remediation deadline (typically within weeks for a CVSS 9.9). Use that deadline as your own internal SLA and brief leadership accordingly.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.