Summary
MCPHub's prompt and resource controllers allow authenticated non-admin users to create or modify globally served prompt templates and resources because the mutating routes lack an administrative authorization check. The altered records take precedence over connected MCP servers, so tampering may affect content delivered to other users and could contribute to prompt injection in their LLM sessions.
Affected context
The issue affects MCPHub deployments using the built-in prompt and resource controllers when authenticated users can reach the mutating prompt or resource API routes. It is most relevant where those routes are exposed through an authenticated router without a separate administrative gate, and where the corresponding DAO records are consulted before connected MCP servers during request handling.
Exploit preconditions
- Attack surface: Authenticated HTTP API routes for prompt and resource creation or modification
- Required access: Any authenticated account, including a non-admin account
- Trigger point: Mutating POST or PUT requests handled by the prompt or resource controllers
- Why exploitation is possible: The routes and handlers do not enforce or evaluate an administrative role before writing global DAO records
Why this happens
The underlying bug is a missing authorization check, mapped to CWE-862: Missing Authorization. Mutating endpoints are placed behind authentication but do not apply the stronger role-based control required for administrative operations, and the handlers do not use the authenticated user's role when deciding whether to perform the write. Because the written singleton records are resolved before connected MCP servers, a lower-privileged user can shadow authoritative content for other sessions.
Potential impact
- Unauthorized users may create or overwrite globally served prompts and resources
- Other users may receive attacker-controlled content in their sessions
- Prompt injection or manipulated resource data could influence downstream LLM behavior
- Administrators may face loss of content integrity and reduced trust in MCP routing
- Connected workflows could make decisions using tampered records
General mitigation guidance
Mitigation generally requires enforcing authorization at every administrative mutation boundary rather than relying on authentication alone.
Common defensive patterns include:
- Require an explicit administrator or resource-owner role for prompt and resource writes
- Apply centralized, deny-by-default authorization middleware to all mutating routes
- Enforce object-level authorization where records have distinct ownership or scope
- Keep globally served records separated from user-controlled data stores
- Validate tenant, scope, and provenance before records can shadow connected MCP data
- Run authorization checks again in service or DAO layers so alternate routes cannot bypass them
- Record and review privileged mutations with audit logging and alerting
How teams detect issues like this
Organizations can identify similar weaknesses through:
- Static analysis for mutating routes that lack authorization middleware or role checks
- Code review checks confirming that authenticated identity and role claims reach write handlers
- Route inventories comparing read and write endpoints against documented privilege policies
- Integration tests proving that non-admin users receive authorization failures for administrative operations
- Monitoring for unexpected changes to globally shared prompts, resources, or routing records
- Policy enforcement requiring explicit authorization annotations on state-changing API handlers
Automated code review and API security testing tools may help detect missing function-level and object-level access controls.

