Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked existing
SHOW PROCESSLIST, processlist visibility, and SQL-visibility issues. Existing reports [Bug]: connections on draining CN are not listed in processlist() #17687, [Tech Request]: show processlist present the real client host #15203, [Tech Request]: more information about prepared statement in statement_info and processlist #13368, [Feature Request]: SHOW PROCESSLIST #10359, [Bug]: unexpected result of SHOW PROCESSLIST #11025, [Bug]: SHOW PROCESSLIST does not list all process #12829, [Bug]:show processlist;sql error occurred on Aliyun Platform #10906, and [Bug]: statement_info result_count is 1 when KILL QUERY returns no rows #27686 cover missing rows, presentation, or unrelated behavior, not cross-user authorization.
Branch Name
main
Commit ID
Other Environment Information
- Hardware parameters: Apple silicon, arm64
- OS type: macOS 15.5 (24F74)
- Others: standalone
mo-servicebuilt bymake build, MySQL-compatible port 26401
Actual Behavior
A user whose grants are only connect plus SELECT on one test table can query information_schema.processlist and read the exact SQL being executed by root in another connection. The issue reproduced 3/3 times with fresh root connections and connection IDs.
Expected Behavior
MySQL 8.0 users without the PROCESS privilege should see only their own process information, not sessions and SQL statements belonging to other users. MatrixOne should enforce an equivalent session-owner or administrative-privilege boundary.
Steps to Reproduce
- Create
loom_readand grant onlySELECTonloom_frontend.priv_athroughloom_read_role(setup as in the repro below). - Start a root query in another connection:
select sleep(5)- While it is running, connect as
loom_readand execute:
SET ROLE loom_read_role;
SELECT conn_id, account, user, info
FROM information_schema.processlist
WHERE info = 'select sleep(5)' ORDER BY conn_id;
SHOW GRANTS;Additional information
pkg/sql/colexec/table_function/processlist.go determines visibility using only the tenant name. For account sys, isSysTenant returns true and the response filter accepts every session in that tenant; there is no requesting-user or PROCESS-privilege check. The predefined information_schema.PROCESSLIST view is an unfiltered projection over this table function. This allowed a non-admin user in sys to see root SQL.
Found by Loom bug hunt (module: sql-frontend; tests: unit, black-box, end-to-end, fuzzing)
Activity
Ariznawlll commentedon Oct 19, 2026
测试版本
main;完整 commit:873282742714436bff407dfcdbbe879147162bd3,包含修复 PR #30299。原问题验证
仓库随修复提供的双 CN+Proxy 公开协议验收脚本在当前 main 重复
3次。三轮都到达最终断连步骤,说明低权限用户在information_schema.processlist、processlist()、SHOW [FULL] PROCESSLIST、prepared 查询和角色切换后的跨用户会话可见性断言均通过;没有在这些原始权限路径再次观察到其他用户 SQL。但整段脚本三轮均在最终连接清理检查失败:已切换身份的普通用户执行中的
SELECT SLEEP(60)遭客户端无COM_QUIT断开后,10 秒期限内后端仍在information_schema.processlist,第 220 行报AssertionError: disconnected backend remained alive。这不是“原 processlist 可见性又回归”的证据,而是同一验收链的未通过路径。Happy Path 覆盖
Unhappy Path 覆盖
3/3失败。另一次未切换身份的 root/Proxy 对照同样在 12.012 秒后仍见后端,提示这可能是通用断连行为;本轮未将其归因于权限过滤代码。白盒验证
本轮只用真实外部协议验证;未执行新的内部 fault/race 测试,也未完成通用断连现象的代码归因。
回归测试
上述公开脚本整体未通过,故未将当前失败场景做成 MOTR #247 的成功 golden。完整 MOTR suite/集成 CI 未在本轮运行。
测试证据
session_authorization.py:220同样失败;此前权限可见性断言均已执行,root 对照 12.012 秒仍存在。测试版本和拓扑如上。测试结论
测试不通过。
Fix proxy cleanup after client disconnect (#30928)
iamlinjunhong commentedon Oct 25, 2026
Local verification failed: the issue still reproduces after #30928
Verified on a local single-node build of
69bbcae(the merge commit of #30928); the server was running normally throughout.The comment's own-user control claim does not hold after Proxy backend cache reuse. After the visible connection ID changes from 908 to 909, the same user's KILL QUERY and KILL CONNECTION, and the administrator's KILL QUERY, all return Unknown connection id 909 while the target SLEEP(60) remains running. MO stays healthy. Fresh Proxy backends and direct-CN controls work. This does not demonstrate a regression in SQL visibility or disconnect cleanup, nor establish that PR #30928 introduced the defect.
Steps to reproduce
Expected
Actual
XuPeng-SH commentedon Oct 25, 2026
Fixed-pin SQL evidence for processlist visibility at
1732bb3297f598bc9a90a41b8c5e4c9557cf0e9c.Command:
PYTHONPATH=/tmp/qa-pymysql python3 /workspace/qa-evidence-1732bb/run_gap_privilege_acceptance.pyagainst the isolated service at127.0.0.1:16601. A task-local sys user with only CONNECT and one table-level SELECT grant queried both processlist entrances while an admin observer confirmed connection 227 was runningSELECT SLEEP(12).The low-privilege user's foreign-user counts were 0 in both
information_schema.processlistandprocesslist(); querying connection 227 returned 0 rows. Its own-session control returned 1 row through both entrances. The harness exited with 0 failures and cleaned up the test user, role, and database.This is a single-service SQL check. It does not test the separate Proxy backend-cache/KILL behavior described in the existing comment.
Ariznawlll commentedon Oct 26, 2026
测试版本
main;完整 commit:5fe08a3307e246e1ab9951ab690b50557af0f509。隔离构建的mo-service经go version -m核对为该 SHA 且vcs.modified=false,服务端git_version()为5fe08a3307。95eb0f0ca39ff33af4d8d6d3e902d6609f08eff0与 PR #30928 合入提交69bbcae88174a017ffa1a8c9f60e8e307d6c41cf,均已核实在该官方 main 祖先链上。原问题验证
仓库现有
test/manual/issue30276_30278/session_authorization.py --proxy-port 26001 --cn-ports 26101 26102连续运行 3/3status=PASS。另一个 CN 上 root 的在途查询不再出现在低权限用户的information_schema.processlist或processlist()查询结果中;SHOW PROCESSLIST/SHOW FULL PROCESSLIST、预编译查询及角色切换后可见性都由脚本逐项断言。管理员对照仍可定位该连接。Happy Path 覆盖
SET ROLE降级/升级与同一连接上的COM_CHANGE_USER后,普通查询、预编译和多语句可见性按当前身份变化,3/3 通过。Unhappy Path 覆盖
COM_CHANGE_USER认证和无效角色切换不能留下 root 的旧权限;客户端在执行SLEEP(60)时直接 EOF、不发COM_QUIT,切换用户与未切换 root 对照均在 10 秒内从 processlist 消失,3/3 通过。临时对象已清理。白盒验证
本轮为实际双 CN+Proxy 的公开协议验收;未新增或重跑 Go UT/race,不把 PR 自带结果当作本轮执行。
回归测试
已把该完整协议路径加入 MOTR #278 的 issue_30276_30278_session_authorization.py。MOTR runner 在该隔离拓扑
--branch main --repeat 3:3 success、0 failed、0 skipped。完整 suite 与新提交 CI 尚未运行/核对;未向 MO 仓库提交 PR。测试证据
/private/tmp/mo-qa-new-20261026-ROza73/motr-278/var/log/run-1792982035360182000/results.jsonl,提交 SHAed0f538e28e9bd8aacbbbed8f8a91e42d9b42b15。测试结论
测试通过。