# MCP data exposure and logging risks

URL: https://mcpservercybersecurity.com/mcp-risk-register/data-exposure-and-logging/
Updated: 2026-11-16

Seven risks cover where secrets and data end up: inherited environment variables, plaintext token files, exfiltration through legitimate calls, secrets requested by elicitation, missing tool-call records, secrets inside logs and protected data returned through resource templates. Each row has controls and a primary source, read on 16 Nov 2026.

## What this dimension covers

Where secrets and data end up: environment, token storage, exfiltration channels and logs. The register holds 7 rows here (R-36, R-37, R-38, R-39, R-40, R-41, R-42). Each row states what the risk is, its impact, concrete controls and at least one primary source.

Sources: [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security); [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html); [GHSA-g5xv-mhgm-v5f6: mcp-atlassian plaintext OAuth token storage](https://github.com/advisories/GHSA-g5xv-mhgm-v5f6).

## Highest-severity rows

Rows that meet the high rule under the written rule are: R-36 Secrets inherited through the environment; R-38 Data exfiltration through legitimate tool calls.

- R-36: A server that needs one key can read all of them.
- R-38: Data leaves through channels that policy allows.

Sources: [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security); [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html); [GHSA-g5xv-mhgm-v5f6: mcp-atlassian plaintext OAuth token storage](https://github.com/advisories/GHSA-g5xv-mhgm-v5f6); [MCP Inspector security documentation](https://modelcontextprotocol.io/docs/tools/inspector/security).

## First controls to apply

Start with the controls on the high rows, then work down. Controls name settings only where a primary source documents them; check each against the version your clients run.

- R-36: Start servers with a minimal environment and pass only the variables each one needs.
- R-37: Use the OS credential store (macOS Keychain, Windows Credential Manager, Linux Secret Service).
- R-38: Monitor for credentials or sensitive values from one server appearing in calls to another.
- R-39: Reject servers that request secrets in form mode and use URL mode for credential steps.
- R-40: Log every tool invocation with full parameters, user context and timestamp.
- R-41: Redact secrets and personal data before storing tool-call logs.
- R-42: Check authorization for the final resource that is returned, not the template.

Sources: [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security); [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html); [GHSA-g5xv-mhgm-v5f6: mcp-atlassian plaintext OAuth token storage](https://github.com/advisories/GHSA-g5xv-mhgm-v5f6); [MCP Inspector security documentation](https://modelcontextprotocol.io/docs/tools/inspector/security).

## Data exposure and logging: 7 items

### R-36: Secrets inherited through the environment

A server started by the client inherits the environment of the host process, which often holds cloud keys and tokens.

**Impact:** A server that needs one key can read all of them.

**Controls:**

- Start servers with a minimal environment and pass only the variables each one needs.
- Use separate credentials per server with the least privilege.
- Keep secrets in an OS credential store rather than in the shell profile.

Severity: high

Sources: [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security) (read 2026-11-16); [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html) (read 2026-11-16).

### R-37: Tokens stored in plaintext

A server or client saves OAuth tokens in a file with loose permissions or in plain text. mcp-atlassian advisories GHSA-g5xv-mhgm-v5f6 and GHSA-4596-2p6p-28cv describe this, and the Inspector's docs say its secrets fall back to a plaintext file when no OS keychain exists.

**Impact:** Any local process or user that can read the file gets the tokens.

**Controls:**

- Use the OS credential store (macOS Keychain, Windows Credential Manager, Linux Secret Service).
- Set file permissions to the owner only where files are unavoidable.
- Never store tokens in MCP config files, which the OWASP cheat sheet also says.

Severity: medium

Sources: [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html) (read 2026-11-16); [GHSA-g5xv-mhgm-v5f6: mcp-atlassian plaintext OAuth token storage](https://github.com/advisories/GHSA-g5xv-mhgm-v5f6) (read 2026-11-16); [MCP Inspector security documentation](https://modelcontextprotocol.io/docs/tools/inspector/security) (read 2026-11-16).

### R-38: Data exfiltration through legitimate tool calls

Injected instructions encode sensitive data into ordinary-looking calls, such as search queries or email subjects.

**Impact:** Data leaves through channels that policy allows.

**Controls:**

- Monitor for credentials or sensitive values from one server appearing in calls to another.
- Restrict which tools can send data outside the organization and require approval for them.
- Limit the data each server can read in the first place.

Severity: high

Sources: [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html) (read 2026-11-16).

### R-39: Sensitive data requested through form elicitation

A server uses form-mode elicitation to ask the user for a password, API key or token, which passes through the client.

**Impact:** Secrets pass through the client and its logs. The spec forbids it.

**Controls:**

- Reject servers that request secrets in form mode and use URL mode for credential steps.
- Show which server is asking and let the user decline.
- Review elicitation requests during server vetting.

Severity: medium

Sources: [MCP Elicitation, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/client/elicitation) (read 2026-11-16).

### R-40: No record of tool calls

Tool invocations are not logged with their parameters, user and time, so there is nothing to investigate after an incident.

**Impact:** A misuse or a poisoned call cannot be reconstructed, and anomalies go unseen.

**Controls:**

- Log every tool invocation with full parameters, user context and timestamp.
- Send the logs to a SIEM and alert on new tools, admin-level queries and unusual call rates.
- Keep the logs long enough to cover an investigation window you set.

Severity: medium

Sources: [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html) (read 2026-11-16); [MCP Security Best Practices, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices) (read 2026-11-16).

### R-41: Secrets and personal data written into logs

Logging full parameters also records secrets and personal data that appear in arguments and results.

**Impact:** The log store becomes a second place to steal credentials from.

**Controls:**

- Redact secrets and personal data before storing tool-call logs.
- Restrict who can read the logs and set a retention period.
- Test the redaction rules with sample credentials.

Severity: medium

Sources: [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html) (read 2026-11-16).

### R-42: Protected data returned through resources and templates

Resources and resource templates expose data by URI, and a template can retrieve a resource that a rule denied.

**Impact:** Data outside a caller's rights is returned. FastMCP's GHSA-7xgj fix makes a denied concrete resource shadow a matching template.

**Controls:**

- Check authorization for the final resource that is returned, not the template.
- Avoid overlapping proxy templates for protected resources.
- Test reads for denied URIs through every route.

Severity: medium

Sources: [GHSA-7xgj-8392-5q4r: FastMCP post-transform authorization](https://github.com/advisories/GHSA-7xgj-8392-5q4r) (read 2026-11-16); [MCP Tools, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/server/tools) (read 2026-11-16).

## Related pages

- [The full MCP Risk Register](/mcp-risk-register/)
- [Execution and filesystem](/mcp-risk-register/execution-and-filesystem/)
- [Supply chain](/mcp-risk-register/supply-chain/)
- [Method](/mcp-risk-register/methodology/)
- [MCP Security Checklist](/mcp-security-checklist/)
