- Issue created by @gagosha
- π¬πͺGeorgia gagosha
1. Add 'use mcp server' permission and access checks
- Added new permission
use mcp server
for basic MCP access - Updated routing to require this permission for the
/mcp/post
endpoint - Implemented
hasAccess()
checks in plugin base class with support for administrative override - Added permission validation in JSON-RPC methods (
ResourcesRead
,ToolsCall
)
2. Token authentication user selection
- Added user selection field in authentication settings form
- Token authentication can now be configured to use any user account
- Updated
McpAuthProvider
to load the configured user instead of hardcoded user 1 - Added validation to ensure configured user exists and is active
- Improved flood protection to use correct user ID
3. Content plugin opt-in behavior
- Changed default behavior to opt-in (all content types disabled by default)
- Updated form to clearly indicate opt-in behavior with description
- Modified
isContentTypeEnabled()
to returnFALSE
by default - Added test updates to reflect new behavior
4. DrushCaller security improvements
- Implemented command allowlist system with categorization by risk level:
- Safe commands (read-only, enabled by default)
- Moderate risk (cache operations, disabled by default)
- Dangerous commands (database/file modifications, disabled by default with warnings)
- Added form-based configuration for granular command control
- Implemented strict mode for exact command matching
- Added ability to configure custom commands
- Command validation in both
getTools()
andexecuteTool()
methods - Clear security warnings in UI for dangerous commands
- Added new permission
-
gagosha β
committed d16972e4 on 1.x
Resolve #3526963 "Security improvements"
-
gagosha β
committed d16972e4 on 1.x
- π¬πͺGeorgia jibla
@gagosha
β 1. I see the permission.
β 2. I see user selection in token authentication.
β 3. Content types are disallowed by default.
β4. Regarding drush - I don't see the granular form described, but the textarea. Is it how its intended to be used? - π¬πͺGeorgia gagosha
@jibla, just update the above comment for DrushCaller. Since the allowlist categorization doesnβt seem so stable, I decided to make it a text area where the user can opt-in to allowed commands or use the * wildcard.