MCP05
- Location
plugin/dist/monitor-X_2pOSNX.mjs:6395- Finding
Declared UAT Security Restrictions Are Not Enforced in the Reviewed User-Token Execution Path ## Remediation Suggestions 1. **Enforce UAT policy centrally.** Resolve the effective channel-level and account-level UAT configuration before token retrieval, refresh, authorization, or execution. Reject user-token operations when `enabled` is explicitly `false`. 2. **Apply scope restrictions consistently.** Reject operations requiring blocked scopes or scopes outside a configured allowlist. Define precedence explicitly, with blocked scopes taking priority. 3. **Cover existing credentials.** Re-evaluate policy on every invocation so that previously stored tokens cannot bypass newly configured restrictions. Disabling UAT access should also cancel pending authorization flows. 4. **Restrict authorization requests.** Apply the same policy to automatic authorization, onboarding, and batch authorization. Do not request scopes prohibited by local configuration. 5. **Add regression tests.** Verify rejection with a valid stored token when UAT is disabled, when required scopes are blocked, and when required scopes fall outside the allowlist. Include account-specific overrides and configuration changes after authorization. 6. **Document actual behavior.** Until enforcement is implemented, clearly identify these settings as unsupported rather than presenting them as effective security controls.
- Content
View full analysis
Vulnerability Details
File Location:
plugin/dist/index.mjs:964–968— declaration of UAT security settings.plugin/dist/monitor-X_2pOSNX.mjs:6395— beginning of the user-token execution method.
Vulnerability Type: Missing enforcement of security configuration
Risk Level: Medium
Validation Status: Statically identified; not runtime-tested.Technical Analysis
The plugin exposes settings for disabling user access tokens (UATs) and restricting their scopes:
javascript const UATConfigSchema = z.object({ enabled: z.boolean().optional(), allowedScopes: z.array(z.string()).optional(), blockedScopes: z.array(z.string()).optional() }).optional();However, the reviewed execution method checks the application owner, stored credentials, and provider-granted scopes without consulting these settings:
javascript async invokeAsUser(toolAction, fn, requiredScopes, userOpenId, appScopeVerified) { if (!userOpenId) throw new UserAuthRequiredError("unknown", { apiName: toolAction, scopes: requiredScopes, appScopeVerified, appId: this.account.appId }); await assertOwnerAccessStrict(this.account, this.sdk, userOpenId); const stored = await getStoredToken(this.account.appId, userOpenId); if (!stored) throw new UserAuthRequiredError(userOpenId, { apiName: toolAction, scopes: requiredScopes, appScopeVerified, appId: this.account.appId }); if (appScopeVerified && stored.scope && requiredScopes.length > 0) { const userGrantedScopes = new Set(stored.scope.split(/\s+/).filter(Boolean)); const missingUserScopes = requiredScopes.filter((s) => !userGrantedScopes.has(s)); if (missingUserScopes.length > 0) throw new UserAuthRequiredError(userOpenId, { apiName: toolAction, scopes: missingUserScopes, appScopeVerified, appId: this.account.appId }); } try { return await callWithUAT({ userOpenId, appId: this.account.appId, appSecret: this.account.appSecret, domain: this.account.brand }, (acces ...[truncated 2688 chars]
