Summary
A critical authentication bypass in Meta Ads MCP allows network-reachable callers to invoke MCP tools without presenting credentials. If a tool falls back to the server's environment token and an upstream request fails, the same token may be exposed in an error response.
Affected context
The vulnerability occurs in Meta Ads MCP deployments that expose Streamable HTTP endpoints before the authentication middleware rejects unauthenticated requests. It is especially risky when tool handlers use the META_ACCESS_TOKEN environment variable as a fallback and error handling includes upstream request URLs containing credentials.
Exploit preconditions
- Attack surface: Network-reachable Streamable HTTP MCP endpoint
- Required access: Ability to send requests to the exposed MCP server; valid credentials are not required
- Trigger point: An unauthenticated request reaching a downstream MCP tool handler
- Additional exposure condition: The handler uses the server-side
META_ACCESS_TOKENfallback and an upstream API request fails in a way that is returned to the caller - Why exploitation is possible: Authentication middleware forwards unauthenticated requests instead of terminating them with an authorization response, while error serialization can include sensitive query parameters
Why this happens
The primary defect is an authentication enforcement failure mapped to CWE-287: Improper Authentication. The middleware does not establish a valid authentication decision before dispatching requests to protected MCP tools, allowing unauthenticated callers to reach privileged functionality.
A related insecure pattern is placing access tokens in request URLs and serializing raw client-library request details into externally visible error responses. This can turn a server-side credential into a response-disclosure issue when downstream requests fail.
Potential impact
- Unauthenticated callers may invoke Meta Ads MCP tools
- Attackers could perform unauthorized advertising or account-management actions
- Server-side Meta access tokens may be disclosed
- Exposed credentials could enable broader access to connected Meta resources
- The incident could result in data manipulation, financial loss, or reputational damage
General mitigation guidance
Mitigation generally focuses on enforcing authentication at the boundary and preventing privileged fallback behavior from being reachable through unauthenticated requests.
Common defensive patterns include:
- Rejecting unauthenticated requests before MCP tool dispatch with a consistent authorization response
- Applying authentication and authorization checks to every tool invocation path
- Avoiding server-wide credential fallbacks when per-request authorization is required
- Keeping access tokens out of URLs and using protected request headers or equivalent mechanisms
- Returning sanitized, structured errors that exclude request URLs, headers, tokens, and other secrets
- Limiting token scope and runtime privileges according to the minimum required operations
- Treating MCP endpoints as private by default and restricting network exposure
How teams detect issues like this
Detection approaches can include:
- Static analysis and code review checks for middleware paths that forward requests without an explicit authentication decision
- Tests verifying that every unauthenticated MCP route returns an authorization failure before tool execution
- Searches for environment-token fallbacks in request handlers and for access tokens embedded in URLs
- Logging and monitoring of tool calls that lack an authenticated principal
- Response inspection and secret-scanning rules for tokens or credential-bearing URLs in JSON-RPC errors
- Policy enforcement requiring redacted, structured error handling at external service boundaries
Automated code review and secret-scanning tools may help identify these patterns during development.

