Fix: Undocumented Parameters Hardening#175
Open
wdaimee wants to merge 2 commits into
Open
Conversation
… are passed to the tools, removing high risk fields from the inputSchema of create and update application tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves the security ticket SEC-30819.
Previously, the
auth0_create_applicationandauth0_update_applicationtool handlers forwarded several parameters to the Auth0 Management API that were not declared in the tools'inputSchema. Since MCP clients only surface schema-declared parameters for human approval, undeclared parameters could bypass human-in-the-loop review. This PR closes that gap by removing high-risk parameters, declaring the remaining ones, and adding a server-side allowlist.Changes
Removed high-risk parameters from
auth0_create_applicationandauth0_update_applicationso they can no longer be forwarded to the Auth0 Management API through these tools:custom_login_page,custom_login_page_on,custom_login_page_preview,addons,encryption_key,client_authentication_methods,require_proof_of_possession,require_pushed_authorization_requests,signed_request_object,compliance_level,form_template,client_metadata, andinitiate_login_uri.Declared lower-risk parameters in
inputSchemaso they remain usable but are now surfaced for human approval:web_origins,client_aliases,cross_origin_loc,oidc_logout,sso, andnative_social_login. Also addedgrant_types,jwt_configuration,mobile, andrefresh_tokentoauth0_create_application(already present on update) so both tools expose a consistent set of parameters.Added a server-side allowlist in
src/server.tsthat rejects any argument not declared in the invoked tool'sinputSchema.propertiesbefore it reaches the handler, returningRejected undeclared parameters: <keys>. Tools that declare no schema properties skip the check.Declared the
clientparameter onauth0_create_resource_serverandauth0_update_resource_server. The handlers already consumed it but the schema omitted it, so the new allowlist would otherwise reject it.Added tests:
test/server.test.ts— covers the allowlist: rejecting undeclared params, allowing fully-declared params, and skipping enforcement when no schema properties are declared.test/tools/tool-parameter-schema.test.ts— enforces theinputSchemacontract across every tool, failing if any handler reads a parameter not declared in its schema.References
https://auth0team.atlassian.net/browse/SEC-30819
https://auth0team.atlassian.net/browse/PSREV-2877
Testing
inputSchema:sso,web_originsweb_originand set agrant_type:inputSchema:Steps to test this branch:
npm run buildandnpm test— all new and existing tests should pass.auth0_create_applicationwith a removed field (e.g.custom_login_page): confirm it is rejected as an undeclared parameter and not forwarded to Auth0.auth0_create_application/auth0_update_applicationwith a newly declared field (e.g.web_originsorsso): confirm it is surfaced in the client's approval prompt and applied on approval.name+app_type+web_origins) still creates/updates the application successfully.All Unit tests pass
All tools work when given the parameters defined in their respective
inputSchemaChecklist