oathe / scan / reports / caution
Is makhatib/mcp-microsoft365 safe?
Use with caution. makhatib/mcp-microsoft365 is not clearly unsafe, but the audit flagged risks to review before you install it. Oathe's behavioral security audit gave the mcp-microsoft365 skill by makhatib a trust score of 78/100 with 9 findings (1 critical, 3 high).
https://github.com/openclaw/skills/tree/main/skills/makhatib/mcp-microsoft365
Is makhatib/mcp-microsoft365 safe to install?
The mcp-microsoft365 skill is technically clean with no prompt injection, malicious code, suspicious install behavior, or active data exfiltration detected during the audit. However, the skill requests extraordinary application-level Microsoft Graph permissions granting org-wide read/write access to all employees' email, files, Teams messages, and calendar — privileges that are inherently dangerous to grant any AI agent component. The primary risk is that if the hosting agent is compromised via prompt injection from external content it processes (email bodies, file content, Teams messages), this skill provides a complete toolkit for corporate data exfiltration and social engineering using legitimate Microsoft Graph API calls.
What security issues were found in makhatib/mcp-microsoft365?
Category Scores
Findings (9)
CRITICAL Application-Level Graph Permissions Grant Org-Wide Data Access to All Users -35 ▶
The skill requires Microsoft Graph application permissions (not delegated user permissions), which require admin consent and apply organization-wide to ALL users without individual user consent. Permissions include Files.ReadWrite.All (read/write every employee's OneDrive), Mail.ReadWrite and Mail.Send (read and send email as any user), Chat.ReadWrite.All (read/send all Teams conversations), Calendars.ReadWrite, Tasks.ReadWrite.All, and User.Read.All. This is an extraordinary privilege grant for an AI agent component. The skill's all-19 tools accept a 'user' parameter allowing any org member to be targeted.
Evidence: SKILL.md Setup section: 'Add these Application permissions for Microsoft Graph: Mail.Read, Mail.Send, Mail.ReadWrite, Calendars.Read, Calendars.ReadWrite, Files.Read.All, Files.ReadWrite.All, Tasks.Read.All, Tasks.ReadWrite.All, Chat.Read.All, Chat.ReadWrite.All, User.Read.All — Important: Click Grant admin consent'. src/index.ts getAccessToken() uses client_credentials grant_type confirming application-level auth.
HIGH Skill Creates High-Value Pivot Point for Prompt Injection Attacks Against the Org -45 ▶
The 19 tools exposed by this skill constitute a complete organizational data exfiltration and manipulation toolkit. If the hosting agent processes any external content containing a prompt injection payload — including email body text read via m365_mail_read, OneDrive file content returned by m365_files_read, or Teams messages from m365_teams_messages — an attacker gains indirect control of a tool that can: read any employee's email and files, send email as any user (ideal for spear phishing or BEC), enumerate the org directory, access confidential Teams conversations, and create calendar events or tasks. The legitimate use of these tools is indistinguishable from malicious use by a compromised agent at the API level.
Evidence: Tool capabilities: m365_mail_send (to/cc arbitrary recipients, HTML body), m365_files_read (returns raw file content up to 50,000 chars), m365_users_list (full org enumeration with jobTitle/department), m365_teams_messages (read private chat content). All tools accept user parameter enabling cross-user targeting with application permissions.
HIGH OData Filter Injection in m365_mail_list -12 ▶
The filter parameter in m365_mail_list is URL-encoded and directly concatenated into the Microsoft Graph API query string. While URL encoding mitigates some injection vectors, OData filter expressions are complex and Microsoft Graph's server-side validation may not prevent all injection scenarios. An attacker could craft filter expressions that access unintended message fields, bypass expected filtering logic, or cause unexpected data to be returned.
Evidence: src/index.ts m365_mail_list handler: `if (args.filter) endpoint += '&$filter=' + encodeURIComponent(args.filter);` — user-controlled OData expression with URL encoding as sole protection, no allowlist or structural validation
HIGH Path Parameter Injection in m365_files_list -8 ▶
The path parameter in m365_files_list is directly interpolated into the Microsoft Graph API endpoint using string concatenation without any sanitization, normalization, or validation. A crafted path value could potentially access files at unintended OneDrive locations, traverse to parent directories, or reference shared folders not intended by the operator.
Evidence: src/index.ts m365_files_list handler: `const path = args.path ? ':/' + args.path + ':' : ''; const endpoint = '/users/' + user + '/drive/root' + path + '/children?...'` — no path sanitization before insertion into API URL
MEDIUM Cross-User Targeting Enabled by 'user' Parameter Across All Tools -23 ▶
Every one of the 19 tools accepts an optional 'user' parameter that selects which organization member's data to access, defaulting to the configured DEFAULT_USER. Combined with application-level permissions (which require no per-user consent), this allows any organization member to be targeted simply by supplying their email address. A compromised agent could systematically access the data of executives, administrators, or other high-value targets.
Evidence: All tool inputSchema definitions include: `user: { type: 'string', description: 'User email (default: configured user)' }`. getAccessToken() uses client_credentials (application auth), meaning permission to access any user's data is implicit in the token.
MEDIUM Azure AD Client Secret Stored as Plain Environment Variable -12 ▶
The Azure AD client secret (which grants org-wide M365 access) is read from a plain environment variable and stored as a plain string in memory. If the agent process is compromised, memory is dumped, or environment variables are logged or exposed, the client secret would provide full organizational Microsoft 365 access to an attacker until rotated. No secrets management, HSM integration, or credential rotation mechanism is provided.
Evidence: src/index.ts: `const CLIENT_SECRET = process.env.CLIENT_SECRET!;` stored in module scope as plain string. Configuration example in SKILL.md shows CLIENT_SECRET in mcporter.json config file, which may be stored unencrypted on disk.
LOW SKILL.md Transparently Discloses High-Privilege Setup Requirements -5 ▶
The SKILL.md documentation clearly and accurately describes all required permissions and setup steps including admin consent. This transparency is a positive signal (no hidden capabilities), though the detailed Azure AD app registration instructions could serve as a copy-paste guide for a malicious actor seeking to create a similarly-privileged application. No prompt manipulation or injection is present.
Evidence: SKILL.md Setup section accurately lists all 12 Microsoft Graph permissions required and instructs user to 'Grant admin consent'. No discrepancy between documented and implemented capabilities found in source review.
INFO Clean Installation via Git Sparse-Checkout with Expected Network Behavior 0 ▶
The skill installed via standard git sparse-checkout from the openclaw/skills monorepo. Network traffic was limited to GitHub (140.82.121.4:443) for git clone and Ubuntu package servers for monitoring system activity. No npm install was executed during the audit, no unexpected processes were spawned, and no new network listeners were created. The filesystem diff shows only the six expected skill files were added.
Evidence: EXECVE audit log shows: git clone --depth 1 --branch main https://github.com/openclaw/skills.git, git sparse-checkout set skills/makhatib/mcp-microsoft365, git checkout, cp -r to skill-under-test/. No node, npm, or tsx execution. Connection diff shows no new listeners post-install.
INFO Canary File Accesses Confirmed as Monitoring Framework Operations 0 ▶
Honeypot files were accessed at two timestamps: 1771919093.674 (before git clone at 1771919099) and 1771919117.513 (post-install verification). Both access clusters show all six canary files accessed within less than 1 millisecond in sequential order — a pattern characteristic of automated monitoring framework sweeps, not organic skill behavior. No skill code (node/npm) was executed during the audit, making skill-originated access impossible. All canary file content remains unmodified.
Evidence: auditd PATH records: items 269-274 at timestamp 1771919093.674 (pre-clone); items 1465-1470 at 1771919117.513 (post-install). 'All canary files intact' confirmed by monitoring system. No EXECVE entries for node, tsx, or npm during audit window.
Should I install makhatib/mcp-microsoft365?
Oathe's verdict for makhatib/mcp-microsoft365 is CAUTION with a trust score of 78/100. Recommendation: Review before install.