Repository navigation
fix(cubejs): fifth review of the confinement (multi-hop row rules, query deadlines) - #107
Merged
Merged
Conversation
- Row rules: every cube instance a member path passes through is ruled, not only the last one. A ruled table joined in the middle of a multi-hop alias path (top.mid.lf.label, mid = semantic_events) was read across tenants. memberPathHops walks the compiled model exactly as Cube's resolveMemberPath does; index.js passes the hops with the resolver. - In-process engines: DuckDB queries, streams and initSql, and SQLite queries, are interrupted past CUBEJS_DB_LOCAL_QUERY_TIMEOUT (default 300s). A never-ending query held a libuv worker; four froze DNS, crypto and file I/O for the whole pod. UV_THREADPOOL_SIZE=64. - DuckDB: COPY ... TO and EXPORT DATABASE refused (no disk quota bounds them; the shared disk could be filled). The review's exploits rerun against this image: closed (multi-hop leak filtered; pod stays responsive after the wedge attack). 762/762. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
A fifth adversarial review of the merged confinement (#103–#106) confirmed three findings, all reachable with default config.
top.mid.lf.label, wheremid→ semantic_events) gets no row rulememberPathHopswalks the compiled model exactly as Cube'sresolveMemberPathdoes, andindex.jspasses the hops with the resolverCUBEJS_DB_LOCAL_QUERY_TIMEOUT(default 300 s);UV_THREADPOOL_SIZE=64COPY … TO/EXPORT DATABASEVerification
yarn test: 762/762, including new tests for the multi-hop rule, both engines' deadline interrupts, and COPY/EXPORT refusal.B-labelfilter oracle returns nothing./test): tenant B still gets 200, and DNS, WebCrypto and file reads stay ok.Residual
Tenant DuckDB and SQLite still run in the cube process. With 64 workers and the deadline, an attacker needs 64 concurrent long queries to stall the pod, and only for up to 300 s. Moving them out of process is the durable fix.
🤖 Generated with Claude Code