Repository navigation
Document that SQLToolset does not check functions without allowed_tables - #74444
Merged
Merged
Conversation
kaxil
reviewed
Oct 8, 2026
Without allowed_tables, a SELECT can still call side-effecting functions such as nextval or pg_terminate_backend. Recommend a least-privilege role.
- Recommend a least-privilege role together with a read-only role/session default, and note that a transaction cannot be set from the Dag. - State that the allowed_tables function check rejects only functions sqlglot cannot type, so typed syntax such as T-SQL NEXT VALUE FOR or Snowflake seq.nextval still passes.
Lee-W
force-pushed
the
common-ai-deps-and-security-docs
branch
from
October 9, 2026 04:53
502f952 to
938b642
Compare
kaxil
approved these changes
Oct 10, 2026
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.
Why
SQLToolsetrejects write statements by scanning the parsed statement, but withoutallowed_tablesit does not examine function calls inside aSELECT. The docs missed it. ASELECTcan therefore still call side-effecting functions such asnextval,pg_terminate_backendordblink_exec. These pass validation and run with the connection's privileges.What
providers/common/ai/docs/toolsets/sql.rst: add a paragraph that says the check inspects statement types, not what a function does. It also says that withoutallowed_tablesa function call inside aSELECTis not examined. Settingallowed_tablesturns on the function check: every function sqlglot cannot type is rejected unless it is listed inallowed_functions. Either way, it recommends a least-privilege role, and a read-only transaction or session where the database supports one.providers/common/ai/docs/agent_security.rst: in the SQLToolset read-only row of the layers table, add the same limitation and the same recommendation.Was generative AI tooling used to co-author this PR?
Generated-by: [Claude] following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.