Repository navigation
cherrypick: add protected database - #25058
2 commits merged into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Protected-database enforcement is still bypassable through CALL, so the PR does not yet guarantee that protected DBs are safe from non-admin writes.
CallStmt marks the statement as writing directly, but does not populate writeDatabaseTargets, and the new protected-db guard returns early when that slice is empty. The procedure body then executes through a background session created without preserving fromRealUser, while the new helpers explicitly skip enforcement for non-real-user sessions. In practice, a non-admin can still modify a protected database by invoking a stored procedure whose body performs DDL/DML there.
Please preserve fromRealUser when executing procedure bodies and/or enforce protected-db checks on each statement executed inside procedures, then add a regression covering a non-admin CALL that writes into a protected database.
存储过程 是废的, 不能正常工作。 暂不考虑call的完整权限问题。 |
What type of PR is this?
Which issue(s) this PR fixes:
issue #24954
What this PR does / why we need it:
增加 protected database