Repository navigation
Conversation
Impersonated command-service sessions skip the login checks, ACCOUNT LOCK included (verified in #252). run_as() now reads account_locked from the session's security context (set by the account lookup at connect) and fails the call with ER_ACCOUNT_HAS_BEEN_LOCKED before CONNECT is announced or any statement runs. A context that cannot be read counts as locked. DISCONNECT is now emitted only after CONNECT was. test-mcp-endpoint.sh: lock -> both tools refused (3118), unlock -> works. 33 checks; the previous build fails the two lock checks. Part of #256 (RFC 0001 Phase 5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 2, 2026
This branch has not been deployed
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.
Phase 5 item from #256: the
account_lockedcheck.Problem
component_mcpruns each call in an impersonated"local"command-service session. Impersonation skips the login checks, so an account withACCOUNT LOCKcould still be used through the endpoint (verified in #252).Change
run_as()readsaccount_lockedfrom the session's security context, viamysql_thd_security_contextandmysql_security_context_options. The account lookup at connect (acl_getroot→lock_account) sets it.ER_ACCOUNT_HAS_BEEN_LOCKED(3118, the server's own message). This happens beforeCONNECTis announced to the guard and before any statement runs.ACCOUNT LOCKtakes effect on the next call.DISCONNECTis now emitted only whenCONNECTwas emitted. Before, it was emitted for any session with a THD.Tests
scripts/test-mcp-endpoint.shonmysql:26.10.0: 33 passed, 0 failed. New checks:ACCOUNT LOCK→run_queryandlist_databasesboth fail with 3118;ACCOUNT UNLOCK→ the account works again.The current main build fails both lock checks: it returns rows for the locked account (31/33).
Docs:
docs/MCP_COMPONENTS.mdand CHANGELOG.Independent of #257 (bounded consumer). Both touch
run_as(), so the second to merge gets a merge from main.Part of #256.
🤖 Generated with Claude Code