Back to skill

Security audit

Outlook Api

Security checks for vulnerabilities and agentic risk

Overview

The skill coherently documents an Outlook integration, but it grants broad email, calendar, contact, connection, and credential-handling authority without enough safety guidance.

Install only if you are comfortable giving this skill access to a Maton API key connected to Outlook. Use narrowly scoped Microsoft permissions where possible, explicitly confirm any send, move, delete, or connection-management action, specify the intended connection when multiple accounts exist, and do not print or share MATON_API_KEY values.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:455
Finding
Plaintext Disclosure of the Maton API Key## Vulnerability Details **File Location**: `SKILL.md`, line 455 **Vulnerability Type**: Plaintext sensitive credential exposure **Risk Level**: Medium **Complete Code Snippet**: ```bash echo $MATON_API_KEY ``` ### Technical Analysis The troubleshooting instructions print the complete `MATON_API_KEY` bearer credential to standard output. Displaying a secret is unnecessary for determining whether the environment variable is configured. The exposed value may persist in terminal scrollback, agent tool output, CI/CD logs, shell-session recordings, debugging captures, or support transcripts. The project uses this credential in the `Authorization` header for `gateway.maton.ai` and `ctrl.maton.ai`, making possession of the value sufficient to authenticate to those services within the key's authorized scope. The documented third-party network communication itself is disclosed and necessary for the Skill's managed OAuth proxy architecture. The vulnerability is specifically the unnecessary plaintext display of the credential. ### Attack Path 1. A user or agent encounters an authentication problem and follows the troubleshooting instructions. 2. `echo $MATON_API_KEY` prints the complete bearer credential. 3. The output is retained in terminal scrollback, agent logs, CI logs, a session recording, or material shared with support. 4. An attacker or unauthorized operator obtains access to that retained output. 5. The attacker inserts the exposed value into an `Authorization: Bearer` header. 6. The attacker authenticates to the documented Maton gateway or connection-management endpoints. 7. Subject to the API key's permissions and connected Microsoft OAuth scopes, the attacker accesses or modifies Outlook resources or connection state. ### Impact Assessment Successful exploitation may allow impersonation of the API-key holder against Maton services. Depending on the key's authorization scope and active Outlook connections, pot ...[truncated 519 chars]
Remediation
## Remediation Suggestions 1. Remove the command that prints the credential. 2. Test only whether the variable is populated: ```bash if [ -n "${MATON_API_KEY:-}" ]; then echo "MATON_API_KEY is set" else echo "MATON_API_KEY is not set" fi ``` 3. Avoid printing, logging, tracing, or including the key in diagnostic reports. 4. Add explicit guidance that users must redact authorization headers and credentials before sharing logs or terminal output. 5. Advise immediate rotation of any key previously printed into retained or shared output. 6. Where supported, use narrowly scoped, short-lived, and revocable credentials and restrict the associated Microsoft OAuth scopes to those required by the task. 7. Ensure logging systems redact values associated with `MATON_API_KEY` and `Authorization` headers.
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
#### Delete Mail Folder

```bash
DELETE /outlook/v1.0/me/mailFolders/{folderId}
```

#### List Child Folders
Confidence
88% confidence
Finding
This endpoint enables deletion of mail folders, a destructive action that can remove large collections of user email or disrupt mailbox organization if the agent is induced to pass the wrong folder identifier. Because the skill documentation presents the operation directly with no guardrails, an agent could be tricked into destructive parameter use through prompt ambiguity or malicious instructions.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
#### Delete Message

```bash
DELETE /outlook/v1.0/me/messages/{messageId}
```

#### Move Message
Confidence
90% confidence
Finding
This endpoint allows permanent or semi-permanent deletion of email messages, which can destroy records, evidence, or business-critical communications if an attacker or ambiguous prompt causes the wrong message ID to be used. The danger is amplified by email's sensitivity and by the absence of confirmation and recovery guidance in the skill.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
#### Delete Event

```bash
DELETE /outlook/v1.0/me/events/{eventId}
```

### Contacts
Confidence
87% confidence
Finding
This endpoint enables deletion of calendar events, which can cause missed meetings, business disruption, or silent tampering with a user's schedule if misused. In an agentic environment, destructive scheduling operations are particularly sensitive because users may not notice immediately and the docs provide no warning or confirmation pattern.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
#### Delete Contact

```bash
DELETE /outlook/v1.0/me/contacts/{contactId}
```

## Query Parameters
Confidence
86% confidence
Finding
This endpoint allows deletion of contacts, which can result in loss of personal or business relationship data and downstream workflow issues if the wrong contact ID is provided. The risk is lower than mailbox-wide destructive actions but still material because the skill surfaces the operation without user-safety checks or reversibility guidance.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The invocation guidance is broad enough that an agent may select this skill for many generic Outlook-related requests without clearly scoping whether the user intended read-only access, sensitive mailbox access, or state-changing operations. In a managed-OAuth email skill, over-broad routing increases the chance of unintended access to messages, contacts, and calendar data or accidental execution of higher-risk actions.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation exposes destructive operations such as deleting connections and later deleting folders, messages, events, and contacts, but does not warn that these actions may be irreversible or require explicit user confirmation. In an agent setting, this omission raises the likelihood of accidental data loss if the model follows user prompts too literally or misinterprets intent.

Static analysis

Detected: suspicious.exposed_resource_identifier

Example code exposes a concrete connection_id instead of a placeholder.

Critical
Code
suspicious.exposed_resource_identifier
Location
SKILL.md:103