Microsoft’s Copilot Studio can be weaponized to steal OAuth tokens — an attack chain Datadog Security Labs has dubbed “CoPhish” — by hosting malicious agents on Microsoft domains and using the agents’ built‑in sign‑in workflows to deliver convincing OAuth consent prompts that exfiltrate tokens to attacker infrastructure.
Microsoft’s Copilot Studio and related agent tooling are designed to let organizations and individuals build low‑code AI assistants (agents) with customizable “topics” and a hosted demo page so others can try the agent. That convenience is also the attack surface CoPhish exploits: a malicious actor can create or configure an agent so its Login topic triggers an OAuth consent flow for an attacker‑controlled application and then immediately forward the resulting access token to a third‑party endpoint under the attacker’s control. Because the agent’s demo page is hosted on Microsoft infrastructure (copilotstudio.microsoft.com), the UI and domain look legitimate — increasing the chance victims will accept consent requests.
Datadog’s proof‑of‑concept shows how the agent’s topic automation can send the token directly from Microsoft infrastructure (not from the victim’s browser), hiding the exfiltration from outbound traffic logs and making detection by simple network monitoring difficult. The result: an attacker can obtain a bearer token that grants Microsoft Graph permissions the victim approved — for example Mail.ReadWrite or Notes.ReadWrite — and then act on behalf of the user through APIs or Copilot actions.
CoPhish combines three high‑impact primitives:
However, important caveats remain:
Defenders must treat Copilot Studio and other low‑code agent platforms as part of the identity threat surface: enforce least privilege, harden consent policies, monitor identity telemetry closely, and require phishing‑resistant authentication for privileged roles. These operational controls — combined with platform hardening by vendors — are the best means to reduce the risk that a friendly looking AI assistant becomes a silent token harvester.
This analysis synthesizes Datadog’s technical write‑up and independent reporting on the CoPhish technique, and it recommends prioritized, defensible mitigations administrators can apply today to reduce the odds of token theft via Copilot Studio agents.
Source: Techzine Global How attackers use Microsoft agents to steal OAuth tokens
Background
Microsoft’s Copilot Studio and related agent tooling are designed to let organizations and individuals build low‑code AI assistants (agents) with customizable “topics” and a hosted demo page so others can try the agent. That convenience is also the attack surface CoPhish exploits: a malicious actor can create or configure an agent so its Login topic triggers an OAuth consent flow for an attacker‑controlled application and then immediately forward the resulting access token to a third‑party endpoint under the attacker’s control. Because the agent’s demo page is hosted on Microsoft infrastructure (copilotstudio.microsoft.com), the UI and domain look legitimate — increasing the chance victims will accept consent requests. Datadog’s proof‑of‑concept shows how the agent’s topic automation can send the token directly from Microsoft infrastructure (not from the victim’s browser), hiding the exfiltration from outbound traffic logs and making detection by simple network monitoring difficult. The result: an attacker can obtain a bearer token that grants Microsoft Graph permissions the victim approved — for example Mail.ReadWrite or Notes.ReadWrite — and then act on behalf of the user through APIs or Copilot actions.
Why CoPhish matters: OAuth token theft, trust, and automation
The core problem: delegated consent and trusted hosting
OAuth is intentionally built to let users grant third‑party applications delegated access to their resources. That model depends on users being able to reason about what they’re consenting to and on governance rules that limit what non‑verified apps can request or what non‑administrators can approve.CoPhish combines three high‑impact primitives:
- A legitimate Microsoft domain hosting the lure (trusted appearance).
- A standard OAuth consent flow that issues bearer tokens when users approve permissions.
- Low‑code automation inside the agent that can forward tokens or immediately take actions using those tokens.
The social‑engineering multiplier
Visual trust is powerful: users are conditioned to trust known brands and domains. An agent demo page that looks like a first‑party Copilot UI on a Microsoft domain erodes common red flags (unknown domain, bad TLS, odd layout) and therefore dramatically increases the probability a user — even an administrator — will grant consent. Attack success is still social engineering at scale; but the trust anchor changes from “a convincing fake page” to “an apparently legitimate Microsoft page.”Technical anatomy: step‑by‑step
How an attacker sets up CoPhish
- Create (or compromise) a Copilot Studio agent in any Entra ID tenant with a Copilot Studio license or trial. The agent can be in the attacker’s tenant; cross‑tenant targeting is possible because the demo URL lives on Microsoft infrastructure.
- Modify the agent’s Login topic (or other relevant automation topics) so that the sign‑in triggers an OAuth authorization request for an application that the attacker controls — requesting delegated scopes such as Mail.ReadWrite, Mail.Send, or Notes.ReadWrite.
- Add an automation step that forwards the obtained token (for example, as an HTTP header or POST) to an attacker‑controlled endpoint (Burp Collaborator in the PoC). Because the request originates from Copilot Studio, it will originate from Microsoft’s IPs.
- Distribute the agent’s demo URL (copilotstudio.microsoft.com/…) via phishing email, Teams message, or other lures. The victim clicks, sees the familiar UI, clicks Login, authorizes the application, and is unaware that the token has been forwarded.
What the stolen token allows
- Acting as the user via Microsoft Graph: read/write email, send messages, enumerate files, manage calendar invites.
- Immediate automation from the agent itself: the agent can use the token to call Graph endpoints to fetch data, inject content, or create further lures (for example, phishing emails sent from the victim’s mailbox).
Who is at risk?
High‑value targets
- Administrators with consent‑granting roles (Application Administrator, Cloud Application Administrator) are top targets because they can approve broader scopes and app permissions that end users cannot. If an admin consents, the attacker can request far more powerful scopes.
- Regular users remain at risk where tenant consent policies still allow certain delegated scopes (for example Mail.ReadWrite) to be self‑consented by members. Those privileges are enough to read and send email, modify calendars, and escalate attacks internally.
Enterprise-wide exposure
Because Copilot Studio demo pages are shareable and hosted under Microsoft domains, a targeted link can be distributed broadly (email, Teams, corporate forums), creating a low‑effort method for attackers to reach users inside a tenant while preserving the appearance of legitimacy.Detection challenges and forensic footprints
- The exfiltration POSTs can originate from Microsoft IP ranges and will not necessarily show up as outbound connections from the victim’s device, defeating simple egress filtering or network IDS heuristics. Datadog’s PoC specifically demonstrates token forwarding from Microsoft infrastructure rather than the user’s browser.
- Standard web proxies and EDRs that inspect user browser traffic will see the normal authentication flow to Microsoft endpoints, which looks legitimate, making it hard to flag the consent step as malicious.
- The most reliable telemetry comes from Entra ID audit logs (application consent events, new service principal creation, unusual approvals), Copilot Studio admin logs (agent creation/modification), and Graph API call logs made under the user’s identity after consent.
Vendor responses and policy shifts — what Microsoft has changed
Microsoft has historically tightened self‑consent rules and Entra ID application consent defaults to reduce the risk of user‑consented elevation. Datadog’s analysis references Microsoft’s managed policy changes that further limit what regular users can consent to by default, and Microsoft has acknowledged the CoPhish disclosure and indicated product updates and governance changes are forthcoming. Independent reporting confirms Microsoft is investigating and planning mitigations.However, important caveats remain:
- Administrators retain the ability to grant consent to both internal and external unverified applications — a necessary operational capability that also creates an enduring attack surface if not tightly controlled.
- Microsoft’s late‑October/November policy tweaks narrow user consent defaults, but they do not entirely remove the risk for privileged accounts or tenants where custom policies allow member consent to high‑risk scopes.
Practical mitigations — immediate, short‑term, and long‑term
The defensive playbook for CoPhish and similar OAuth consent threats must be layered: governance, telemetry, user hardening, and incident response.Immediate (hours — 48 hours)
- Restrict admin consent scope. Ensure only a minimal, vetted set of identities hold Application Administrator or Cloud Application Administrator roles. Require out‑of‑band approvals for new app consents.
- Enable Microsoft-managed default consent policy or a stricter custom policy that blocks member consent for high‑risk Graph scopes (Mail.ReadWrite, Calendars.ReadWrite, Files.Read.All). Review and apply Microsoft’s updated consent defaults if available.
- Block or monitor Copilot Studio demo links in high‑value workflows. Treat any copilotstudio.microsoft.com demo URL as suspicious until validated for important targets.
- Require phishing‑resistant MFA for privileged users. Implement FIDO2 or platform passkeys for admins to reduce adversary-in‑the‑middle risk.
Short term (days — 2 weeks)
- Audit recently consented applications and service principals. Revoke suspicious or unnecessary consents. Re‑evaluate application permissions and limit them to least privilege.
- Configure alerts for new Copilot agent creation, topic modifications, and demo URL generation in your tenant. Add monitoring for outbound POSTs from Copilot connector automation runs.
- Harden app registration policies: forbid wildcard redirect URIs, restrict validDomains, and require verified publishers for apps requesting sensitive scopes.
Long term (weeks — months)
- Adopt a formal OAuth/consent governance program: periodic audits, justification for scopes, and approval workflows for any app requesting sensitive Graph permissions.
- Expand telemetry to correlate Entra ID audit logs, Graph API activity, and Copilot Studio agent activity. Invest in SIEM rules that detect anomalous Graph calls by users who recently consented to new applications.
- Engage suppliers and staff with targeted education: how to identify suspicious consent dialogs, and how to verify agent demo pages out‑of‑band before consenting. Practical drills can include simulated CoPhish scenarios to test readiness.
Detection and incident response playbook
When you suspect a token compromise via CoPhish or similar OAuth consent phishing:- Revoke the token(s) and refresh tokens and force re‑authentication for the affected user (revokeSignInSessions). This severs the immediate attacker session.
- Search Entra ID audit logs for the app consent event, service principal creation, and newly granted permissions. Record redirect URIs and publisher names.
- Scan Graph activity for actions performed by the compromised identity (sent emails, created calendar events, files accessed). Prioritize containment where attackers used Mail.Send or Mail.ReadWrite to spread further lures.
- Notify impacted users and rotate credentials for any service principals or application secrets that may have been exposed. While changing passwords alone is insufficient if refresh tokens were stolen, rotating app secrets and revoking tokens narrows the attacker’s window.
Critical analysis: strengths, vendor responsibility, and residual risks
Strengths of the attack model
- CoPhish is elegant in its simplicity: it does not require a zero‑day or malware payload. Building a malicious agent, registering an app, and crafting a convincing consent flow are low‑cost operations with high potential impact. Datadog’s PoC demonstrates operational feasibility.
- The use of Microsoft infrastructure to host the lure is a force multiplier for social engineering, exploiting user trust in domains and UI familiarities.
Microsoft’s position and responsibilities
- Microsoft can and is hardening consent defaults and the Copilot Studio governance model — actions that reduce the attack surface for non‑privileged accounts. Public reporting shows Microsoft acknowledged the issue and plans product updates. However, platform hardening must be paired with tenant‑level governance because administrators still retain consent power by design.
Residual risks and caveats
- Even with stricter defaults, privileged roles are an enduring risk; if an admin is socially engineered, an attacker can still obtain powerful tokens. That means role assignment, least privilege, and out‑of‑band approval remain critical.
- The public record to date shows proof‑of‑concepts and confirmed platform weaknesses, but quantifying real‑world exploitation (how many tenants were compromised, how many admins were tricked) remains hard. Early reporting has not demonstrated widescale, confirmed production compromises specifically attributable to Copilot Studio abuse prior to disclosure; treat broad claims of mass compromise as plausible but unquantified until telemetry is published.
Recommendations for WindowsForum readers (practical, prioritized)
- If you’re an admin: Immediately audit who in your tenant can grant app consent. Apply the Microsoft‑managed consent defaults or a stricter custom policy. Enforce phishing‑resistant MFA (FIDO2) for all privileged roles. Add Copilot Studio demo URL monitoring to your email/Teams/content filtering.
- If you’re a security engineer: Build SIEM detections for post‑consent Graph calls, new service principal creation events, and Copilot agent creation/modification events. Correlate these signals to detect post‑consent abuse faster.
- If you’re an end user: Treat any consent dialog that requests broad access to your mailbox or files with suspicion. Validate the request out‑of‑band (e.g., ask the issuer via a separate verified channel) before consenting. If you see unexpected sent mail or calendar invites, report immediately.
Final assessment
CoPhish is a clear reminder that as enterprise systems gain automation and low‑code extensibility, the attack surface shifts from purely technical vulnerabilities to governance and human trust. The technique described by Datadog is practical, leverages existing OAuth flows, and benefits from Microsoft hosting to increase social engineering success. Microsoft’s policy changes and commitments to product updates are necessary steps, but they are not a comprehensive fix for tenant governance gaps — especially where high‑privilege administrative consent remains a capability.Defenders must treat Copilot Studio and other low‑code agent platforms as part of the identity threat surface: enforce least privilege, harden consent policies, monitor identity telemetry closely, and require phishing‑resistant authentication for privileged roles. These operational controls — combined with platform hardening by vendors — are the best means to reduce the risk that a friendly looking AI assistant becomes a silent token harvester.
This analysis synthesizes Datadog’s technical write‑up and independent reporting on the CoPhish technique, and it recommends prioritized, defensible mitigations administrators can apply today to reduce the odds of token theft via Copilot Studio agents.
Source: Techzine Global How attackers use Microsoft agents to steal OAuth tokens
