Summary
Obsidian Web MCP versions before 0.2.0 can issue OAuth authorization codes and exchange them for vault access without verifying a user, session, or client. An unauthenticated remote caller who can reach the intended tunnel deployment may access MCP operations that read, search, modify, move, or delete content across the vault.
Affected context
The issue occurs in Obsidian Web MCP deployments where the OAuth authorization and token endpoints are reachable through the configured tunnel. Risk is present when those endpoints do not require an authenticated user, explicit consent, a valid session, or client authentication before issuing or exchanging credentials. Optional PKCE does not by itself establish user authentication or prevent an attacker from initiating the authorization flow.
Exploit preconditions
- Attack surface: The remotely reachable
/oauth/authorize,/oauth/token, and potentially/oauth/registerendpoints - Required access: Network reachability to the intended tunnel deployment; no valid user authentication is required
- Trigger point: An attacker-initiated OAuth flow followed by access to the MCP endpoint
- Why exploitation is possible: Authorization and token issuance proceed without sufficient user, session, or client verification, potentially exposing the configured vault access token or related client credentials
Why this happens
The underlying flaw is an authentication and authorization design failure. OAuth endpoints issue authorization material without confirming that a legitimate user has logged in, granted consent, or established a valid session, while token exchange does not adequately authenticate the requesting client. This maps primarily to CWE-306: Missing Authentication for Critical Function, with related exposure involving insufficient credential protection under CWE-522 and unsafe authorization-flow handling related to CWE-601.
Potential impact
- An unauthenticated caller may read and search vault content
- An attacker could create, modify, move, or delete vault files
- Confidential notes, credentials, or other sensitive information may be disclosed
- Vault integrity and availability could be compromised
- Exposed tokens or client secrets may enable continued unauthorized access
General mitigation guidance
Mitigation generally focuses on enforcing authentication and authorization at every sensitive OAuth and MCP boundary.
Common defensive patterns include:
- Require an authenticated user session and explicit consent before issuing authorization codes
- Authenticate and validate OAuth clients before token exchange
- Avoid returning configured secrets through unauthenticated registration or discovery paths
- Bind authorization codes to the authenticated user, client, redirect context, and a short expiration period
- Treat PKCE as an additional control rather than a replacement for user and client authentication
- Apply least privilege to vault operations and separate read access from destructive actions
- Restrict tunnel exposure, rotate credentials after suspected disclosure, and maintain auditable access controls
How teams detect issues like this
Detection can combine application review, runtime monitoring, and policy enforcement:
- Use static analysis and code review to identify OAuth handlers that issue codes or tokens without session, consent, or client checks
- Test authorization endpoints with no session, invalid clients, altered redirect contexts, and repeated requests
- Monitor for token issuance, vault operations, and registration activity associated with anonymous callers
- Enforce policies requiring authentication and authorization middleware on all sensitive routes
- Review whether secrets or bearer tokens appear in unauthenticated responses or logs
- Use automated security testing and code review tools to flag missing access-control checks

