Commit Graph

5 Commits

Author SHA1 Message Date
Joe Li
0cc04ff8a2 fix(mcp): handle SSL connection drop during pre-call session teardown (#39917)
Manual port of apache/superset#39917 (commit 85935b0b) onto 6.0-release.
A clean cherry-pick does not apply because mcp_service/auth.py has diverged
structurally on this branch, but the vulnerable code path is present verbatim:
sync_wrapper calls db.session.remove() before user resolution on reused
thread-pool threads. If the thread-local DBAPI connection died between
requests (RDS SSL idle-timeout / max-connection-age), the implicit rollback
raises a DBAPIError and crashes the tool call.

Wrap the pre-call remove in _remove_session_safe(), which catches DBAPIError,
invalidates the dead connection so the pool discards it, and retries remove()
so the tool proceeds on a fresh connection. Ports the accompanying regression
test byte-for-byte behaviorally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 14:21:40 -07:00
Amin Ghadersohi
f7429845d5 fix(mcp): API key authentication for MCP — transport, validation, and RBAC (#39604)
(cherry picked from commit 7d69f76127)
2026-06-05 17:44:00 -07:00
Elizabeth Thompson
bae1342956 fix(mcp): clear stale thread-local DB session in sync tool wrapper (#39798)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit 98eaaaa6d6)
2026-05-01 11:12:10 -07:00
Amin Ghadersohi
6f6fb14e1a fix(mcp): remove JWT ValueError g.user fallback in auth layer (#39106)
(cherry picked from commit 92747246fc)
2026-04-13 10:16:50 -07:00
Amin Ghadersohi
799f18a626 fix(mcp): prevent stale g.user from causing user impersonation across tool calls (#38747)
(cherry picked from commit 38fdfb4ca2)
2026-04-13 10:16:48 -07:00