rusackas opened a new pull request, #42935:
URL: https://github.com/apache/superset/pull/42935

   ### SUMMARY
   
   Two related MCP service fixes:
   
   - The default MCP user resolver maps JWT claims to Superset users by 
username/email without binding the token's `iss` claim. When `MCP_JWT_ISSUER` 
was configured with more than one trusted issuer, this meant distinct issuers 
minting tokens with the same username/email would resolve to the same Superset 
user, and the service only logged a warning about it. Added 
`validate_multi_issuer_user_resolver()`, called both at MCP auth provider 
startup and from `_resolve_user_from_jwt_context`, so this configuration now 
raises `MCPAuthConfigError` instead of proceeding — mirroring the existing 
fail-closed checks already in place for `MCP_JWT_AUDIENCE` and the guest-token 
secret. Documented the requirement in `SECURITY.md` and `PRODUCTION.md`.
   - `sanitize_user_input()` and `sanitize_filter_value()` in the MCP input 
sanitizer ran their keyword/pattern checks before stripping 
zero-width/control-character Unicode, while `sanitize_sql_expression()` in the 
same module already canonicalized first. Reordered both to canonicalize before 
validating, matching the existing order in `sanitize_sql_expression()`.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   pytest tests/unit_tests/mcp_service/test_mcp_multi_issuer_identity_binding.py
   pytest tests/unit_tests/mcp_service/test_auth_user_resolution.py
   pytest 
tests/unit_tests/mcp_service/utils/test_sanitization_unicode_ordering.py
   pytest tests/unit_tests/mcp_service/
   ```
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to