T09 · Insecure Skill Coding Practices
- Location
SKILL.md:29- Finding
OAuth tokens and client secrets stored in plaintext without enforced access controls
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 29–38 and 196–203
Vulnerability Type: Plaintext sensitive credential storage
Risk Level: MediumVulnerable Code Snippets
markdown ### Config File: `~/.outlook-mcp/config.json` ```json { "client_id": "your-app-client-id", "client_secret": "your-app-client-secret", "owner_email": "owner@domain.com", "delegate_email": "assistant@domain.com" }text ```markdown ## Security Considerations 1. **Audit Trail**: All actions by the assistant are logged in the owner's mailbox audit log 2. **Token Storage**: Credentials stored in `~/.outlook-mcp/` - protect this directory 3. **Scope Limitation**: The assistant only has access to what the owner explicitly grants 4. **Revocation**: The owner can revoke access anytime via Delegate settings ## Files - `~/.outlook-mcp/config.json` - Client ID, secret, and owner/delegate emails - `~/.outlook-mcp/credentials.json` - OAuth tokens (access + refresh)Technical Analysis
The Skill instructs users to store an OAuth client secret, access token, and long-lived refresh token in ordinary files under
~/.outlook-mcp/. Local credential storage is necessary for the declared Microsoft Graph integration, but the documentation neither creates the directory and files with restrictive permissions nor requires permission validation before use. It also does not recommend an operating-system credential manager or encrypted secret store.Merely advising users to “protect this directory” does not enforce confidentiality. Depending on the user's
umask, file creation method, backup configuration, or synchronization tools, the files could be readable by other local users or processes. Refresh tokens are particularly sensitive because they may be exchanged for new access tokens and can provide continuing access until revoked or invalidated.The documented
outlook-token.sh getoperation also ...[truncated 1940 chars]- Remediation
View remediation
Remediation Suggestions
-
Create the credential directory with owner-only permissions:
bash install -d -m 0700 "$HOME/.outlook-mcp" -
Create credential-bearing files with mode
0600, and set a restrictiveumaskbefore writing them:bash umask 077 install -m 0600 /dev/null "$HOME/.outlook-mcp/config.json" install -m 0600 /dev/null "$HOME/.outlook-mcp/credentials.json" -
Validate ownership and permissions before loading credentials. Refuse operation if the directory is not owned by the current user or if group/other permissions are present.
-
Prefer an operating-system keychain, encrypted secret manager, or managed identity mechanism over plaintext JSON files. Store only non-secret identifiers such as email addresses in the configuration file.
-
Avoid printing access tokens to standard output. If a token retrieval operation is indispensable, require explicit confirmation, avoid logging, and clearly warn users that the output is sensitive.
-
Exclude the credential directory from source control, cloud synchronization, diagnostics, and unencrypted backups.
-
Request only permissions required by the intended deployment. Avoid Exchange
FullAccesswhen Reviewer, Editor, or folder-specific delegation is sufficient. -
Document concrete token-revocation and incident-response procedures, including revoking refresh tokens, rotating client secrets, removing Exchange delegation, and reviewing Microsoft 365 audit logs after suspected exposure.
-
Add automated checks or tests confirming that credential files are never written with permissions broader than
0600.
-
