Files
0pt/evidence/bi-p017/analyst-sql-live-bypass.json
T
Claude Opus 5 c864c8c417
CI (SIAX Cloud) / integration (push) Successful in 40s
CI (SIAX Cloud) / quality (push) Successful in 55s
CI (SIAX Cloud) / security (push) Successful in 21s
Security Scan (SIAX Cloud) / security (push) Successful in 22s
CI (SIAX Cloud) / integration (pull_request) Successful in 39s
CI (SIAX Cloud) / quality (pull_request) Successful in 54s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 21s
CI (SIAX Cloud) / security (pull_request) Successful in 25s
fix(analytics): revert 18 files reformatted by mistake, and actually apply the Iceberg fix a previous message claimed
Two corrections, both of my own errors.

1. SCOPE CREEP, NOW REVERTED. Running `prettier --write` on whole directories
   reformatted 18 files this branch had no business touching — the entire
   merged BI-P002..P012 core (arrow/, domain/, engine/, repositories/, five
   analytics integration suites) and, absurdly,
   search-opensearch.integration.test.ts, which has nothing to do with this
   work. The changes were purely stylistic quote churn, but they added ~1,400
   lines of noise to the diff, made the PR harder to review honestly, and
   invited conflicts with the four other lanes working in this estate. All 18
   are now byte-identical to origin/main again (verified with `git diff
   origin/main --name-only`, which reports nothing for them). Formatting is now
   applied only to the files this branch actually owns.

2. A COMMIT MESSAGE THAT DESCRIBED A FIX THAT WAS NOT IN THE CODE. Commit
   3ee0230 said the "does NOT ship the Iceberg table" assertion had been moved
   from a filesystem check to `git ls-files`. It had not. The patch anchor used
   double quotes, prettier had already converted that file to single quotes, so
   the replacement silently matched nothing and the script printed its success
   line anyway. The suite then passed — but only because I had just deleted the
   fixture directory, so the OLD filesystem assertion happened to be true.

   That is precisely the failure mode this branch keeps writing tests against:
   a green run that means something different from what it appears to mean. The
   fix is now genuinely applied and verified the way it should have been the
   first time — by running the suite WITH the Iceberg fixture present on disk,
   which is the case that previously failed. It passes, and it now also asserts
   that the parquet/csv fixtures ARE tracked, so a version shipping no fixture
   at all would fail rather than pass vacuously.

957 tests pass with ClickHouse, Postgres and DuckDB live. typecheck, eslint and
prettier clean on the files this branch owns.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 03:16:30 +02:00

845 lines
43 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"prompt": "BI-P017",
"claim": "Every bypass attempt, executed directly against a live ClickHouse as the tenant's restricted user WITH THE STATEMENT GUARD REMOVED, fails to return a foreign-tenant row, an ungranted-table row, or server metadata.",
"clickhouse_version": "24.8.14.39",
"recorded_at": "2026-09-07T01:15:43.364Z",
"base_table_rows_both_tenants": 100,
"tenant_view_rows_alpha": 50,
"attempts_total": 64,
"attempts_that_leaked": 0,
"legitimate_statements_that_succeeded": 10,
"legitimate_statements_total": 10,
"attempts": [
{
"id": "cross-catalog-direct",
"goal": "read the other tenant's catalog",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"t_beta_sql\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(customer, amount, event_time)"
},
{
"id": "cross-catalog-union",
"goal": "union in the other tenant",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"t_beta_sql\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(customer) ON t_beta_sql.sales."
},
{
"id": "cross-catalog-subquery",
"goal": "subquery on the other tenant",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"t_beta_sql\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT for at least one column on t_b"
},
{
"id": "cross-catalog-join",
"goal": "join the other tenant",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"t_beta_sql\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(customer) ON t_beta_sql.sales."
},
{
"id": "cross-catalog-cte",
"goal": "hide the other tenant in a CTE",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"t_beta_sql\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(customer) ON t_beta_sql.sales."
},
{
"id": "cross-catalog-quoted",
"goal": "quote the identifier to dodge the scan",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"t_beta_sql\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(customer, amount, event_time)"
},
{
"id": "cross-catalog-backtick",
"goal": "backtick the identifier",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"t_beta_sql\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(customer, amount, event_time)"
},
{
"id": "base-table-direct",
"goal": "read the shared base table, which holds every tenant",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"opt_analytics\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(tenant_id, project_id, dataset"
},
{
"id": "base-table-in-cte",
"goal": "base table behind a CTE",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"opt_analytics\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(tenant_id) ON opt_analytics.op"
},
{
"id": "base-table-union",
"goal": "union the base table in",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"opt_analytics\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(tenant_id) ON opt_analytics.op"
},
{
"id": "system-tables",
"goal": "enumerate every table on the server",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "opt_analytics events opt_analytics sales t_alpha_sql events t_alpha_sql sales"
},
{
"id": "system-columns",
"goal": "enumerate columns",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "opt_analytics events tenant_id String 1 0 0 0 0 1 1 0 \\N \\N \\N \\N \\N opt_analytics events customer String 2 0 0 0 0 0 0 0 \\N \\N \\N \\N \\N opt_analytics e"
},
{
"id": "system-users",
"goal": "enumerate users",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(name, id, storage, auth_type,"
},
{
"id": "system-processes",
"goal": "read other tenants' running queries",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(query) ON system.processes. (A"
},
{
"id": "system-query-log",
"goal": "read other tenants' statement text out of the log",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(query) ON system.query_log. (A"
},
{
"id": "information-schema",
"goal": "metadata via the ANSI schema",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"information_schema\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(table_catalog, table_schema, t"
},
{
"id": "one-table",
"goal": "the always-present one-row table",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "0"
},
{
"id": "tf-url",
"goal": "exfiltrate over HTTP",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"url\" is not permitted in an analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant CREATE TEMPORARY TABLE, URL ON *.*. ("
},
{
"id": "tf-file",
"goal": "read the server filesystem",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"file\" is not permitted in an analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant CREATE TEMPORARY TABLE, FILE ON *.*."
},
{
"id": "tf-s3",
"goal": "read object storage directly",
"engine_http_status": 400,
"engine_clickhouse_code": "36",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"s3\" is not permitted in an analyst session",
"engine_response_head": "Code: 36. DB::Exception: Bucket name length is out of bounds in virtual hosted style S3 URI: 'b' (http://minio/b/%2A). (BAD_ARGUMENTS) (version 24.8.14.39 (offi"
},
{
"id": "tf-remote",
"goal": "query another ClickHouse server",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"remote\" is not permitted in an analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant CREATE TEMPORARY TABLE, REMOTE ON *.*"
},
{
"id": "tf-mysql",
"goal": "reach an external database",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"mysql\" is not permitted in an analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant CREATE TEMPORARY TABLE, MYSQL ON *.*."
},
{
"id": "tf-executable",
"goal": "run a program",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"executable\" is not permitted in an analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant CREATE TEMPORARY TABLE ON *.*. (ACCES"
},
{
"id": "tf-numbers",
"goal": "a CPU bomb that touches no table",
"engine_http_status": 500,
"engine_clickhouse_code": "158",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"numbers_mt\" is not permitted in an analyst session",
"engine_response_head": "Code: 158. DB::Exception: Limit for rows (controlled by 'max_rows_to_read' setting) exceeded, max rows: 100.00 thousand, current rows: 100.00 billion. (TOO_MANY"
},
{
"id": "tf-generate",
"goal": "unbounded synthetic scan",
"engine_http_status": 500,
"engine_clickhouse_code": "158",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"generaterandom\" is not permitted in an analyst session",
"engine_response_head": "Code: 158. DB::Exception: Limit for rows or bytes to read exceeded, max rows: 100.00 thousand, current rows: 315.79 thousand: While executing GenerateRandom. (T"
},
{
"id": "tf-merge",
"goal": "merge() glob across a database",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"merge\" is not permitted in an analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant CREATE TEMPORARY TABLE ON *.*. (ACCES"
},
{
"id": "tf-cluster",
"goal": "fan out across the cluster",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"cluster\" is not permitted in an analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant REMOTE ON *.*. (ACCESS_DENIED) (versi"
},
{
"id": "tf-view",
"goal": "wrap a subquery in view()",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"view\" is not permitted in an analyst session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(tenant_id, project_id, dataset"
},
{
"id": "fn-dictget",
"goal": "read a dictionary, bypassing table grants",
"engine_http_status": 400,
"engine_clickhouse_code": "36",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"dictget\" is not permitted in an analyst session",
"engine_response_head": "Code: 36. DB::Exception: Dictionary (`d`) not found: In scope SELECT dictGet('d', 'v', toUInt64(1)) AS x FROM t_alpha_sql.sales. (BAD_ARGUMENTS) (version 24.8.1"
},
{
"id": "stacked-drop",
"goal": "stacked statement",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: multiple statements are not allowed in an analyst SQL session",
"engine_response_head": "Code: 62. DB::Exception: Syntax error (Multi-statements are not allowed): failed at position 32 (end of query): ; DROP TABLE opt_analytics.opt_analytics_event ."
},
{
"id": "insert",
"goal": "write",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant INSERT(customer, amount, event_time)"
},
{
"id": "insert-select",
"goal": "write from a read",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant INSERT(customer, amount, event_time)"
},
{
"id": "alter-delete",
"goal": "mutate",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant ALTER DELETE ON opt_analytics.opt_ana"
},
{
"id": "create-view-escape",
"goal": "create an unfiltered view to read later",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant CREATE VIEW ON t_alpha_sql.escape. (A"
},
{
"id": "grant-self",
"goal": "grant itself more",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT ON opt_analytics.* WITH GRANT"
},
{
"id": "system-command",
"goal": "operate the server",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SYSTEM RELOAD DICTIONARY ON *.*. (ACC"
},
{
"id": "kill-query",
"goal": "kill another tenant's query",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(query_id, user, query) ON syst"
},
{
"id": "truncate",
"goal": "destroy data",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant TRUNCATE ON t_alpha_sql.sales. (ACCES"
},
{
"id": "optimize",
"goal": "trigger heavy background work",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant OPTIMIZE ON opt_analytics.opt_analyti"
},
{
"id": "outfile",
"goal": "write to the filesystem",
"engine_http_status": 500,
"engine_clickhouse_code": "358",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"OUTFILE\" is not permitted in a read-only analyst session",
"engine_response_head": "Code: 358. DB::Exception: INTO OUTFILE is not allowed. (INTO_OUTFILE_NOT_ALLOWED) (version 24.8.14.39 (official build))"
},
{
"id": "settings-raise-rows",
"goal": "raise max_rows_to_read",
"engine_http_status": 500,
"engine_clickhouse_code": "164",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SETTINGS\" is not permitted in a read-only analyst session",
"engine_response_head": "Code: 164. DB::Exception: Cannot modify 'max_rows_to_read' setting in readonly mode. (READONLY) (version 24.8.14.39 (official build))"
},
{
"id": "settings-readonly-off",
"goal": "turn readonly off",
"engine_http_status": 500,
"engine_clickhouse_code": "164",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SETTINGS\" is not permitted in a read-only analyst session",
"engine_response_head": "Code: 164. DB::Exception: Cannot modify 'readonly' setting in readonly mode. (READONLY) (version 24.8.14.39 (official build))"
},
{
"id": "set-statement",
"goal": "SET before the query",
"engine_http_status": 500,
"engine_clickhouse_code": "164",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: analyst SQL sessions accept SELECT and WITH statements only",
"engine_response_head": "Code: 164. DB::Exception: Cannot modify 'max_execution_time' setting in readonly mode. (READONLY) (version 24.8.14.39 (official build))"
},
{
"id": "format-override",
"goal": "choose the wire format",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"FORMAT\" is not permitted in a read-only analyst session",
"engine_response_head": "\u00032\bcustomer\u0006String ALPHA_ROW_0 ALPHA_ROW_1 ALPHA_ROW_2 ALPHA_ROW_3 ALPHA_ROW_4 ALPHA_ROW_5 ALPHA_ROW_6 ALPHA_ROW_7 ALPHA_ROW_8 ALPHA_ROW_9 ALPHA_ROW_10 ALPHA_RO"
},
{
"id": "comment-split-name",
"goal": "hide a catalog boundary behind a comment",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: unqualified table \"opt_analytics\" — an analyst statement must name t_alpha_sql.<object>, or a CTE it defined itself",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT(tenant_id, project_id, dataset"
},
{
"id": "comment-line-hide",
"goal": "hide the tail after a -- comment",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "ALPHA_ROW_0 ALPHA_ROW_1 ALPHA_ROW_2 ALPHA_ROW_3 ALPHA_ROW_4 ALPHA_ROW_5 ALPHA_ROW_6 ALPHA_ROW_7 ALPHA_ROW_8 ALPHA_ROW_9 ALPHA_ROW_10 ALPHA_ROW_11 ALPHA_ROW_12 A"
},
{
"id": "comment-hash-hide",
"goal": "hide the tail after a # comment",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "ALPHA_ROW_0 ALPHA_ROW_1 ALPHA_ROW_2 ALPHA_ROW_3 ALPHA_ROW_4 ALPHA_ROW_5 ALPHA_ROW_6 ALPHA_ROW_7 ALPHA_ROW_8 ALPHA_ROW_9 ALPHA_ROW_10 ALPHA_ROW_11 ALPHA_ROW_12 A"
},
{
"id": "unterminated-comment",
"goal": "run off the end of a comment",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [INVALID_REQUEST] 0pt.analytics.sql: unterminated block comment",
"engine_response_head": "Code: 62. DB::Exception: Syntax error: failed at position 33 ('/* x '): /* x . Multiline comment is not closed: '/* x '. (SYNTAX_ERROR) (version 24.8.14.39 (off"
},
{
"id": "unterminated-string",
"goal": "run off the end of a literal",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [INVALID_REQUEST] 0pt.analytics.sql: unterminated string literal",
"engine_response_head": "Code: 62. DB::Exception: Syntax error: failed at position 50 (''x '): 'x . Single quoted string is not closed: ''x '. (SYNTAX_ERROR) (version 24.8.14.39 (offici"
},
{
"id": "unicode-homoglyph",
"goal": "cyrillic homoglyph inside the catalog name",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: statement contains a disallowed character (U+0430) outside a string literal",
"engine_response_head": "Code: 62. DB::Exception: Syntax error: failed at position 17 ('�'): аlpha_sql.sales . Unrecognized token: '�'. (SYNTAX_ERROR) (version 24.8.14.39 (official buil"
},
{
"id": "zero-width",
"goal": "zero-width space inside a reserved catalog name",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: statement contains a disallowed character (U+200B) outside a string literal",
"engine_response_head": "Code: 62. DB::Exception: Syntax error: failed at position 24 ('.'): .tables . Expected one of: FINAL, SAMPLE, table, table function, subquery or list of joined"
},
{
"id": "nul-byte",
"goal": "NUL truncation between two halves of a statement",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: statement contains a disallowed character (U+0000) outside a string literal",
"engine_response_head": "Code: 62. DB::Exception: Syntax error: failed at position 40 ('\u0000'): \u0000 UNION ALL SELECT name FROM system.tables . Unrecognized token: '\u0000'. (SYNTAX_ERROR) (versio"
},
{
"id": "case-mixing",
"goal": "mixed case keywords and names",
"engine_http_status": 404,
"engine_clickhouse_code": "81",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "Code: 81. DB::Exception: Database SyStEm does not exist. Maybe you meant system?. (UNKNOWN_DATABASE) (version 24.8.14.39 (official build))"
},
{
"id": "whitespace-newlines",
"goal": "newlines and tabs between tokens",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"SYSTEM\" is not permitted in a read-only analyst session",
"engine_response_head": "opt_analytics events 204f5e8f-9134-417f-b7f5-569500c15059 MergeTree 0 ['/var/lib/clickhouse/store/204/204f5e8f-9134-417f-b7f5-569500c15059/'] /var/lib/clickhous"
},
{
"id": "describe-subquery",
"goal": "DESCRIBE a base table from inside a subquery, where the FROM-scan sees only a paren",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: DESCRIBE is not permitted in a read-only analyst session",
"engine_response_head": "Code: 62. DB::Exception: Syntax error: failed at position 16 ('DESCRIBE'): DESCRIBE TABLE opt_analytics.opt_analytics_event) . Expected one of: SELECT query, po"
},
{
"id": "desc-subquery-short",
"goal": "the same, using the DESC abbreviation",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: DESCRIBE is not permitted in a read-only analyst session",
"engine_response_head": "Code: 62. DB::Exception: Syntax error: failed at position 16 ('DESC'): DESC TABLE opt_analytics.opt_analytics_event) . Expected one of: SELECT query, possibly w"
},
{
"id": "current-user",
"goal": "identify the session's ClickHouse principal",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: function \"currentuser\" is not permitted in an analyst session",
"engine_response_head": "t_alpha_sql_user t_alpha_sql_user t_alpha_sql_user t_alpha_sql_user t_alpha_sql_user t_alpha_sql_user t_alpha_sql_user t_alpha_sql_user t_alpha_sql_user t_alpha"
},
{
"id": "three-part-name",
"goal": "a three-part name",
"engine_http_status": 400,
"engine_clickhouse_code": "62",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: \"a.b.c\" is not a valid <catalog>.<object> reference",
"engine_response_head": "Code: 62. DB::Exception: Syntax error: failed at position 21 (end of query): . Expected one of: ParserArrayOfJSONIdentifierDelimiter, token sequence, OpeningSqu"
},
{
"id": "unqualified-table",
"goal": "unqualified name resolved by the connection's default database",
"engine_http_status": 404,
"engine_clickhouse_code": "60",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: unqualified table \"opt_analytics_event\" — an analyst statement must name t_alpha_sql.<object>, or a CTE it defined itself",
"engine_response_head": "Code: 60. DB::Exception: Unknown table expression identifier 'opt_analytics_event' in scope SELECT * FROM opt_analytics_event. (UNKNOWN_TABLE) (version 24.8.14."
},
{
"id": "cte-shadow",
"goal": "shadow a legitimate name with a CTE while also reading the real base table",
"engine_http_status": 500,
"engine_clickhouse_code": "497",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: catalog \"opt_analytics\" is not readable by this session",
"engine_response_head": "Code: 497. DB::Exception: t_alpha_sql_user: Not enough privileges. To execute this query, it's necessary to have the grant SELECT for at least one column on opt"
},
{
"id": "no-from",
"goal": "a statement that reads no table at all",
"engine_http_status": 200,
"engine_clickhouse_code": null,
"engine_succeeded": true,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: statement references no readable object in the tenant catalog",
"engine_response_head": "1"
},
{
"id": "object-not-granted",
"goal": "an object in the right catalog that the session was not given",
"engine_http_status": 404,
"engine_clickhouse_code": "60",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "refused: [AUTHORIZATION_DENIED] 0pt.analytics.sql: object \"t_alpha_sql.secret_ledger\" is not readable by this session",
"engine_response_head": "Code: 60. DB::Exception: Unknown table expression identifier 't_alpha_sql.secret_ledger' in scope SELECT * FROM t_alpha_sql.secret_ledger. (UNKNOWN_TABLE) (vers"
},
{
"id": "hidden-tenant-column",
"goal": "select the tenant column the view does not project",
"engine_http_status": 404,
"engine_clickhouse_code": "47",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "admitted",
"engine_response_head": "Code: 47. DB::Exception: Unknown expression identifier 'tenant_id' in scope SELECT tenant_id FROM t_alpha_sql.sales. (UNKNOWN_IDENTIFIER) (version 24.8.14.39 (o"
},
{
"id": "hidden-column-star-then-filter",
"goal": "filter on a column the view does not expose",
"engine_http_status": 404,
"engine_clickhouse_code": "47",
"engine_succeeded": false,
"leaked_foreign_tenant_row": false,
"leaked_ungranted_table_row": false,
"leaked_server_metadata": false,
"guard_verdict_for_reference": "admitted",
"engine_response_head": "Code: 47. DB::Exception: Unknown expression or function identifier 'tenant_id' in scope SELECT count() AS n FROM t_alpha_sql.sales WHERE tenant_id = 't_beta'. ("
}
],
"legitimate": [
{
"id": "simple",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "aggregate",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "cte",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "self-join",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "literal-with-quotes",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "literal-containing-sql-text",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "comment-then-query",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "subquery",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "union-own-catalog",
"ok": true,
"status": 200,
"contains_beta_canary": false
},
{
"id": "trailing-semicolon",
"ok": true,
"status": 200,
"contains_beta_canary": false
}
]
}