fix(sqlite): reject recursive CTE workloads - #2367
Closed
chaliy wants to merge 1 commit into
Closed
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 8e75647 | Commit Preview URL | Aug 31 2026, 10:15 PM |
2 tasks
Contributor
Author
|
Closing in favour of #2369, which counts the work instead of denying the syntax. Two reasons the policy denial doesn't hold up:
#2369 installs that handler: every 1024 VM instructions it charges the request Generated by Claude Code |
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.
Motivation
WITH RECURSIVE, but Bashkit's enforcement points run only aroundStatement::step()and on emitted rows, so a recursive CTE can perform unbounded work inside a single step and bypass cooperative limits.Description
parser::is_recursive_cteto detectWITH RECURSIVE(comment- and case-aware, keyword-boundary validated) incrates/bashkit/src/builtins/sqlite/parser.rs.check_sql_policywith a clear error: "recursive CTEs are not supported in the bashkit sandbox; query work cannot be bounded" incrates/bashkit/src/builtins/sqlite/mod.rs.tm_sql_014_recursive_ctes_are_rejectedincrates/bashkit/tests/integration/sqlite_security_tests.rsthat covers comment-obfuscated forms.knowledge/runtimes/sqlite-builtin.mdto document TM-SQL-014.Testing
sqlite_security_tests::tm_sql_014_recursive_ctes_are_rejectedand it passed.sqlite_differential_tests::non_recursive_cte_matches_hostand it passed.cargo test --features sqlite -p bashkit -- sqlite(108 unit tests and 67 integration tests for the sqlite feature) and all passed.cargo fmt,cargo clippy -- -D warnings) andjust check-okffor knowledge conformance; these passed.Codex Task