Back to skill

Security audit

outlook-mcp

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marked this Outlook-related skill suspicious because it reports meaningful security and permission concerns, while several scanners produced incomplete coverage.

The verdict is suspicious, not a claim that the author is malicious. Consider the confirmed document-parser isolation weakness and calendar notification permission gap before installing; review the skill's permissions and installation source, and use a version you have independently reviewed. Scanner coverage was partial: 97.8% of components were scanned, some files or analyses were only partially inspected, and the separate AIG scan returned no findings, so the evidence is incomplete.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (224)

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · CHANGELOG.md (reported line 441)May include surrounding context.

md
could not, so an agent putting a flight on the calendar had nowhere to put the e-ticket. The new
  `outlook_attach_to_event` attaches files from `attachments_dir` through the same code as
  `outlook_attach_to_draft`: every path is confined by `resolve_attachment_path`, a file up to
  3 MB is one POST, and a larger one uses Graph's upload session for events. It returns the new
  attachment IDs (none yet for a file sent through the upload session).
  `outlook_remove_event_attachment` removes one, and `outlook_get_event` now lists
  `attachments` (ID, name, size, type and whether inline, never the bytes), reading them with a

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · CLAUDE.md (reported line 49)May include surrounding context.

md
- `src/outlook_mcp/tools/` — One file per tool group:
  - `mail_read.py`, `mail_write.py`, `mail_triage.py` — Tier 1 (auth tools live directly in `server.py`)
  - `calendar_read.py`, `calendar_write.py` — Tier 1
  - `calendar_attachments.py` — Event attachments (attach from `attachments_dir`, with the mail tools' upload session for >3MB; remove one)
  - `contacts.py` — Contact CRUD
  - `contact_photos.py` — `outlook_set_contact_photo` (opt-in `contact_photos` group): a JPEG, PNG or GIF from `attachments_dir`, type read from the bytes, capped at 20 MiB by a bounded read, PUT through the SDK's `photo.content`; set only
  - `todo.py` — To Do task management

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · CLAUDE.md (reported line 55)May include surrounding context.

md
- `todo.py` — To Do task management
  - `todo_attachments.py` — To Do task attachments (inline base64 uploads ≤20 MiB, contentBytes downloads)
  - `mail_drafts.py` — Draft management
  - `mail_attachments.py` — Mail attachments: list, download (to `attachments_dir`, or `as_content`), send and attach to drafts; home of `resolve_attachment_path`, the download helpers the To Do tools share, and the >3MB upload session the event tools reuse
  - `mail_attachment_read.py`, `_document_worker.py` — `outlook_read_attachment` (opt-in `documents` group): PDF, XLSX and text attachments as paged text. PDF/XLSX parse in `_document_worker.py`, a short-lived clean-environment subprocess the parent bounds by memory, wall time and output — containment, not a sandbox
  - `mail_mime.py` — `outlook_export_message` (opt-in `mime` group): a message's original bytes from a raw-httpx GET of `$value`, uncompressed, no redirects, streamed to a 10 MiB cap; returned as a JSON block (`size_bytes`, `sha256`) and a

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · README.md (reported line 514)May include surrounding context.

md
. Never replaces an existing file and never creates a hidden (dot) name or writes into a hidden folder; pick a new `save_path`. |
| `outlook_read_attachment` | **Opt-in** (`documents` group, not loaded by default; see below). Read PDF pages, XLSX cells/formulas/saved results, or text in a standard text charset (UTF-8 when none is declared); `offset` / `max_chars` page the text, no file saved. |
| `outlook_send_with_attachments` | Send a message with attachments read from `attachments_dir` (auto upload session for >3MB) or passed inline in `attachments`. If a large upload fails, nothing is sent, and the error names the draft left in Drafts so it can be deleted or finished with `outlook_attach_to_draft` instead of sent twice. |
| `outlook_attach_to_draft` | Add attachments from `attachments_dir` (auto upload session for >3MB) or inline in `attachments` to an existing draft. A failed large upload is an error, never a file reported as attached. Returns the new attachment IDs (none yet for

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · README.md (reported line 515)May include surrounding context.

md
by default; see below). Read PDF pages, XLSX cells/formulas/saved results, or text in a standard text charset (UTF-8 when none is declared); `offset` / `max_chars` page the text, no file saved. |
| `outlook_send_with_attachments` | Send a message with attachments read from `attachments_dir` (auto upload session for >3MB) or passed inline in `attachments`. If a large upload fails, nothing is sent, and the error names the draft left in Drafts so it can be deleted or finished with `outlook_attach_to_draft` instead of sent twice. |
| `outlook_attach_to_draft` | Add attachments from `attachments_dir` (auto upload session for >3MB) or inline in `attachments` to an existing draft. A failed large upload is an error, never a file reported as attached. Returns the new attachment IDs (none yet for an upload-session file). |
| `outlook_remove_draft_attachment` | Remove a single attachment from a draft. |

For **readable document contents** rather than original bytes, use `outlook_read_attachment`.

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · SKILL.md (reported line 131)May include surrounding context.

md
rrence` converts a single event into a series, `remove_recurrence=True` converts it back; patching a time keeps the zone the event is anchored in, and `timezone` (with start and end) re-anchors it elsewhere; a `start`, `end` or `recurrence` patch to a series with edited or deleted occurrences is refused, because Graph would discard them; `key` sets or replaces the event's key; `is_online=True` adds an online meeting (check `is_online` in the result), `is_online=False` is refused because Graph keeps the meeting
- `outlook_delete_event` — Delete event
- `outlook_rsvp` — Accept, decline, or tentatively accept
- `outlook_attach_to_event` — Attach files from `attachments_dir` to an event (auto upload session for >3MB); attendees get them with the event's next update, so an event with attendees needs `mail_send` under `allow_categories`
- `outlook_remove_event_attachment` — Remove one attachment from an event by ID (from the attach result or `outlook_get_event`'s `attachments`)

### Contacts

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · SKILL.md (reported line 174)May include surrounding context.

md
bytes into `attachments_dir` (never replaces a file, no hidden names; pick a new `save_path`), or return them with `as_content=True` (≤10 MB)
- `outlook_read_attachment` — Read PDF pages, XLSX cells/formulas/saved results, or text in a standard text charset without a server-side file; follow `next_offset` until null. Opt-in `documents` group; PDF/XLSX need the `documents` extra; no OCR or formula recalculation
- `outlook_send_with_attachments` — Send with files read from `attachments_dir` (auto upload session for >3MB) or passed inline in `attachments` (≤3MB each). If a large upload fails, nothing is sent and the error names the draft left in Drafts: delete it or finish it with `outlook_attach_to_draft` rather than calling the send again, which makes a second draft
- `outlook_attach_to_draft` — Add attachments to an existing draft, from `attachments_dir` (auto upload session for >3MB) or inline in `attachments` (≤3MB each)
- `outlook_remove_draft_attachment` — Remove a single attachmen

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · SKILL.md (reported line 175)May include surrounding context.

md
eplaces a file, no hidden names; pick a new `save_path`), or return them with `as_content=True` (≤10 MB)
- `outlook_read_attachment` — Read PDF pages, XLSX cells/formulas/saved results, or text in a standard text charset without a server-side file; follow `next_offset` until null. Opt-in `documents` group; PDF/XLSX need the `documents` extra; no OCR or formula recalculation
- `outlook_send_with_attachments` — Send with files read from `attachments_dir` (auto upload session for >3MB) or passed inline in `attachments` (≤3MB each). If a large upload fails, nothing is sent and the error names the draft left in Drafts: delete it or finish it with `outlook_attach_to_draft` rather than calling the send again, which makes a second draft
- `outlook_attach_to_draft` — Add attachments to an existing draft, from `attachments_dir` (auto upload session for >3MB) or inline in `attachments` (≤3MB each)
- `outlook_remove_draft_attachment` — Remove a single attachment from a draft

### Folder Management

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · scripts/preflight.py (reported line 60)May include surrounding context.

python
# tools don't use it (its upload URL needs per-chunk Authorization/Content-Type
# headers the current inline path doesn't), so its reachability says
# nothing about this release. The mail and event attachment tools do use an
# upload session for a file over 3 MB, but creating one is a POST that
# changes the draft or event, so it is not probed here either (the
# ``live_write`` tier's event-attachment round trip exercises the event one).
#

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · src/outlook_mcp/tools/mail_attachments.py (reported line 1104)May include surrounding context.

python
if created is not None and getattr(created, "id", None):
            attachment_ids.append(created.id)

    # Large files — upload session
    if large_files:
        from msgraph.generated.models.attachment_item import AttachmentItem
        from msgraph.generated.models.attachment_type import AttachmentType

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · CHANGELOG.md (reported line 1714)May include surrounding context.

md
way. `_delta.py` deliberately does not persist cursors — "that's the caller's
  job" — so the cursor is agent-held state, and an agent takes instructions from
  the mail it reads. A string like `https://evil.example/collect` arriving in a
  message body was therefore enough to send a live, full-mailbox access token to
  a stranger. Every URL that would carry the token is now parsed and required to
  be https on `graph.microsoft.com` (`require_graph_url`), including the
  `deltaLink` handed back as the next cursor, so a poisoned link is never stored

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/outlook_mcp/tools/_delta.py (reported line 140)May include surrounding context.

python
def _bearer_token(credential: Any) -> str:
    """Mint a Graph access token from an azure-identity credential."""
    tok = credential.get_token(GRAPH_TOKEN_SCOPE)
    return tok.token

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_keychain_collision.py (reported line 72)May include surrounding context.

python
"""

    def __init__(self) -> None:
        self._slot: dict[str, str] = {}  # home_account_id -> access token
        self._signal_files: set[str] = set()
        self.written_names: list[str] = []  # audit: the name given to each save
        self.constructed_cache_names: list[str] = []  # audit: per construction

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

The optional PDF/XLSX worker processes attacker-controlled attachments while retaining the server user's filesystem, network, and potential credential-store access. This is an isolation weakness: if a parser vulnerability permits code execution, removing credential environment variables and imposing resource limits would not prevent access to user-readable secrets or outbound exfiltration; the README alone does not demonstrate such an exploit or prove every Keychain item is accessible.

Content

Scanner excerpt · README.md (reported line 564)May include surrounding context.

md
has a ceiling of 50,000. Text is decoded in-process; all extracted text is cleaned of control
characters before paging. PDF/XLSX use a **subprocess for crash and resource containment,
not a sandbox**: server credential environment variables are absent,
but it runs as the same user with filesystem, network and Keychain access. A parent watchdog
polls RSS every 10 ms and kills a parser above 256 MiB on Linux, macOS and Windows; brief
overshoot between polls is possible. Only one parser runs at a time, with a 30-second wall timeout.
OS resource limits supplement these checks where supported.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · RELEASING.md (reported line 202)May include surrounding context.

And confirm the MCP registry shows the new version as (latest):

bash
curl -s 'https://registry.modelcontextprotocol.io/v0/servers?search=mpalermiti&version=latest' | python3 -c "import json,sys; [print(s['server'].get('version'), '(latest)' if s.get('_meta',{}).get('io.modelcontextprotocol.registry/official',{}).get('isLatest') else '') for s in json.load(sys.stdin).get('servers', [])]"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · pyproject.toml (reported line 40)May include surrounding context.

toml
# checks the rewrite against whatever an install resolves.
    "msgraph-core>=1.5.2",
    # Capped below 1.27 (#244). On macOS, 1.27.0 keeps a named token cache under
    # a Keychain account named after the cache; 1.26 and earlier used one shared
    # account. So under 1.27 the sign-in saved before is not found, and an
    # upgraded install reports "Not authenticated" until `outlook-mcp auth`
    # runs again. Lift once auth.py moves an existing sign-in across.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/outlook_mcp/auth.py (reported line 78)May include surrounding context.

python
"""Return True if msal_extensions will fall back to plaintext caching.

    Mirrors msal_extensions' libsecret-availability check: macOS uses
    Keychain and Windows uses DPAPI, both always encrypted, so only
    Linux is at risk — and only when PyGObject/libsecret isn't
    importable in the current Python environment (the failure mode
    reported in #7 for `uv tool install`).

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/outlook_mcp/cli.py (reported line 157)May include surrounding context.

python
print()
    print(
        "The encrypted token cache the OS keeps for azure-identity "
        "(Keychain item Microsoft.Developer.IdentityService on macOS, its"
    )
    print("equivalent on other systems) is shared across apps and left in place; its tokens")
    print("age out on their own.")

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/outlook_mcp/config.py (reported line 36)May include surrounding context.

python
# Overriding it (and ONLY it) via OUTLOOK_MCP_CONFIG_DIR is how you run a
# second instance against a different mailbox: the MSAL signal file stays at
# ~/.IdentityService/, so both processes still share the lock-and-merge path
# into the one Keychain item. Moving HOME instead would give each process its
# own signal file, neither would see the other's write, and they would clobber
# each other's token. Empty or unset leaves the default in place.
CONFIG_DIR_ENV = "OUTLOOK_MCP_CONFIG_DIR"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/outlook_mcp/graph.py (reported line 31)May include surrounding context.

python
# a SECOND cache: every cache name gets a signal-file suffix in
        # ~/.IdentityService (.nocae for this non-CAE cache, .cae for a CAE
        # one), and the two suffixes are two signal files writing the same
        # host-wide Keychain item — each believing it owns the item, they
        # clobber each other's writes. One non-CAE cache, one signal file:
        # ~/.IdentityService/outlook-mcp.nocae.
        #

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_auth.py (reported line 119)May include surrounding context.

python
"""_unencrypted_fallback_will_be_used mirrors msal_extensions' check."""

    def test_macos_is_never_fallback(self):
        """macOS uses Keychain — fallback is impossible."""
        with patch.object(auth_module.sys, "platform", "darwin"):
            assert _unencrypted_fallback_will_be_used() is False

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_azure_identity_cap.py (reported line 3)May include surrounding context.

python
"""azure-identity stays below 1.27 until a sign-in saved by 1.26 is moved across (#244).

On macOS, 1.27.0 keeps a named token cache under a Keychain account named after
the cache, where 1.26 and earlier used one shared ``MSALCache`` account. An
install that resolves 1.27 cannot find the sign-in saved before it, and reports
"Not authenticated" until ``outlook-mcp auth`` runs again. Dependabot never

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_cli.py (reported line 130)May include surrounding context.

python
assert "auth_record.json" in out
    assert "outlook-mcp auth" in out  # next start asks for auth again
    # the OS cache entry is shared and stays — and the old advice ("remove
    # 'outlook-mcp' from Keychain Access") named an entry that never existed
    assert "Microsoft.Developer.IdentityService" in out
    assert "left in place" in out
    assert "remove 'outlook-mcp'" not in out

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_keychain_collision.py (reported line 6)May include surrounding context.

python
How the cache really works, from azure-identity's own persistence layer:

- On macOS, every persisted azure-identity cache on the host — this server's,
  Visual Studio's, the Azure CLI's — serializes into ONE Keychain item:
  service ``Microsoft.Developer.IdentityService``, account ``MSALCache``.
  ``TokenCachePersistenceOptions(name=...)`` does NOT buy a second Keychain
  item. It buys a distinct *signal file* — on disk

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_keychain_collision.py (reported line 8)May include surrounding context.

python
- On macOS, every persisted azure-identity cache on the host — this server's,
  Visual Studio's, the Azure CLI's — serializes into ONE Keychain item:
  service ``Microsoft.Developer.IdentityService``, account ``MSALCache``.
  ``TokenCachePersistenceOptions(name=...)`` does NOT buy a second Keychain
  item. It buys a distinct *signal file* — on disk
  ``~/.IdentityService/outlook-mcp.nocae``: azure-identity appends a
  suffix to every cache name (``.nocae`` non-CAE, ``.cae`` CAE), so the