Repository navigation
Description
A read-only scan of main at 388a0441b against the secure-by-design rules: inbound identity, scopes, every transport, SQL binding per dialect, brokers and delegation, startup refusals, secrets in logs, bounds on untrusted input, the multi-node worker path, the operator and the chart, TLS, CI and deny.toml.
Limits. Every finding comes from reading source; nothing was built, run, fuzzed or reproduced. Two claims were re-read in the pinned sources before filing: datafusion-proto 55.1.0 panics on an Avro scan node without its avro feature, and axum 0.8.9 serves each connection with no timer, so hyper drops its 30-second header-read default. The release profile is panic = "abort". Not covered: the internals of the vendored and Go/C drivers beyond the one logging path cited, the image build, anything dynamic. No SQL injection was found: on every adapter a caller's value reaches the data system only as a bound parameter, and identifiers come from the catalog through a fixed character set.
Each finding names the smallest fix and the test or gate that would hold it, red today. Each is worked as its own PR that says Part of this issue.
1. Refuse a peer node's malformed plan or reply without stopping the process
- Severity: medium. In scope per SECURITY.md: yes - the shipped binary, a shipped dependency, and the input stops the process.
- Where:
crates/sutura-cli/src/serve/nodes.rs:44,crates/sutura-cli/src/serve/worker.rs:60,crates/sutura-http/src/router/worker.rs:39,crates/sutura-exec-datafusion/src/combine/across.rs:219,505; upstreamdatafusion-distributed4.0.0impl_coordinator_channel.rs:77,datafusion-proto55.1.0physical_plan/mod.rs:1106,arrow-ipc59.2.0reader.rs:66andcompression.rs:313. - What: with nodes declared, a serving node mounts its worker on the listener that serves
/v1and/mcp, gated only on a certificate the node authority signed. The worker decodes a peer's plan beforereads_no_sourceinspects it. The decoder panics on an Avro scan node,arrow-ipctrusts the buffer offsets and uncompressed lengths a sender declares, and both ends setmax_decoding_message_size(usize::MAX). Underpanic = "abort"each of these stops the whole process, so one holder of a node certificate can stop every node, including the serving ones. The same IPC decode sits on the remote-leg parameter batch (crates/sutura-flight/src/receive.rs:87) and a peer's reply (crates/sutura-exec-node/src/call.rs:114); no release shipsflightornodetoday. - Fix: return an error on the Avro arm - propose upstream, vendor
datafusion-protomeanwhile underVENDOR.md; propose an offset and declared-length bound toarrow-ipc; cap the decoding message size on the server sutura builds and on its client. - Held by: a worker-route cell sending a plan with an Avro scan node that expects an error status; a fuzz target under
just fuzzover the plan decode and aFlightDatastream decode. - Related: the task grant (feat(exec): elastic multi-node DataFusion on demand, so a federated question too wide for one replica is answered rather than refused #828, Decision 5) does not cover this unless it is checked before the plan is decoded.
2. Bound how long the public listener waits for a request head
- Severity: medium (low behind a proxy that times out heads). In scope per SECURITY.md: yes - sutura's own listener, reachable with no credential.
- Where:
crates/sutura-http/src/server.rs:205,crates/sutura-http/src/tls/listener.rs:44,51. - What:
axum::servesets no timer, sohyperdrops its header-read timeout. Nothing else bounds an idle or slow connection, or the number of open ones, once a TLS handshake completes or a plaintext socket is accepted. The request timeout, the rate limiter and the body bound are middleware and run only after a full request head. A client with no credential can hold connections until file descriptors or memory run out. This applies wherevertlsTerminationisin-processor the listener is exposed with no proxy in front. - Fix: serve through
hyper-util'sauto::Builderwith aTokioTimer, an HTTP/1 header-read timeout, HTTP/2 keep-alive with a timeout, and a semaphore on open connections shaped like the handshake permits; keep the drain. - Held by: a cell that sends half a request head and expects the server to close the connection within the bound.
3. Refuse to start while the BigQuery driver's debug log is on
- Severity: low - the trigger is an operator setting. In scope per SECURITY.md: yes - a token and a credential reach a log.
- Where:
crates/sutura-cli/src/main.rs:301,crates/sutura-oracle-connect/src/oracle_trace.rs:7,crates/sutura-exec-bigquery/src/adbc/subject.rs:71,313-320. - What: the linked BigQuery driver's Go auth library logs each HTTP request and response, headers and body, unredacted, whenever
GOOGLE_SDK_GO_LOGGING_LEVELis set. That would write the loopback subject-token request with its secret header and the caller's own identity assertion to stderr, outsidetracing, breaking the boundsubject.rs:71states. sutura refuses the Oracle driver's equivalent variable but not this one. Read from the upstream source at the pinned versions; not reproduced against the linked driver. - Fix: a refusal beside
oracle_tracefor that variable at any value, called where the Oracle one is. - Held by: the refusal type and a cell that sets the variable and expects the refusal.
4. Name the Deployments the operator may scale, and give it no node client identity
- Severity: low. In scope per SECURITY.md: no - deployment and RBAC hardening.
- Where:
charts/sutura/templates/worker-pool.yaml:122-129,186-200,charts/sutura/templates/_helpers.tpl:249,crates/sutura-operator/src/reconcile.rs:92,103,117,docs/adr/20261030193029-operator-sizes-the-worker-pool.md:85. - What: the operator's Role may scale every Deployment in its namespace, and it scales whatever a
SuturaWorkerPoolnames, so a principal who may write those objects but not scale Deployments can have it scale another Deployment to zero. Itspods: patchis not limited to annotations. Its pod mounts a node certificate with client auth that passes the node gate on every node, though it reads only the CA bundle. - Fix:
resourceNameson the scale rule; the operator refuses a spec naming any other Deployment; the operator gets only the CA bundle; the ADR says whatpods: patchallows. - Held by: the chart golden under
just chart, and an operator cell refusing a foreign Deployment name.
5. Any certificate from the node authority is a node, and the chart accepts a shared issuer
- Severity: medium when the issuer is shared, otherwise none. In scope per SECURITY.md: no - it depends on the issuer an operator chooses; the chart can refuse the unsafe choice.
- Where:
crates/sutura-http/src/tls/authority.rs:53,crates/sutura-http/src/server.rs:169,charts/sutura/values.yaml:114-118,charts/sutura/templates/_helpers.tpl:213-220,246-249. - What: a node is any client whose certificate chains to the node authority; no name is checked, and a certificate with no extended key usage passes as a client. The chart takes
issuer.kind: ClusterIssuerand any CA issuer. With a shared CA, any workload holding a certificate from it can run stages on every node, make a worker dial node addresses a plan names, and, given a stage key, read another question's stage output. - Fix: the chart refuses
ClusterIssuerunless acknowledged and asks for a dedicated CA; the task grant (feat(exec): elastic multi-node DataFusion on demand, so a federated question too wide for one replica is answered rather than refused #828, Decision 5). - Held by: a refusal fixture under
charts/sutura/testdata/refusals.
6. No NetworkPolicy for the worker, serving or operator pods
- Severity: low. In scope per SECURITY.md: no - deployment hardening.
- What: the headless workers Service is reachable from every namespace; only the certificate check of finding 5 gates it.
- Fix: an opt-in policy in the chart admitting the serving pods and the operator to the workers, pinned by a chart golden.
7. Images are pulled by tag, and the chart cannot take a digest
- Severity: low. In scope per SECURITY.md: no - supply-chain hardening.
- Where:
charts/sutura/templates/_helpers.tpl:286-292. - What: the serving, worker and operator images render as
repository:tag; a repushed tag swaps the binary with no chart change. - Fix: an
image.digestvalue rendered asrepository@digest, pinned by a chart golden.
8. A loopback subject-token URL can reach the error log through the driver's error text
- Severity: informational. In scope per SECURITY.md: yes in class, no practical impact today - the listener closes on drop and its secret header is still needed.
- Where:
crates/sutura-exec-bigquery/src/adbc/subject.rs:318,crates/sutura-exec-bigquery/src/adbc/driver_message.rs:45,crates/sutura-http/src/routes/v1/query.rs:414. - What: when fetching the subject token fails, the driver's error text can carry the loopback URL with its nonce into the logged cause chain;
driver_message.rsstrips only console links. The guarantee atsubject.rs:71is worded stronger than this. Unverified that the driver passes the text through verbatim. - Fix: strip loopback URLs in
driver_message.rs, held by a cell over such a text.
9. Unbounded reads of operator-supplied files
- Severity: low. In scope per SECURITY.md: no - the inputs are the operator's own.
- Where:
crates/sutura-cli/src/password_file.rs:28,crates/sutura-catalog-wren/src/lib.rs:77. - What: a password file and a wren manifest are read with
read_to_string: no size cap, a FIFO hangs the read, and the password's untrimmed copy is never zeroized. - Fix: read both through
sutura-bounded-read.
10. The deny.toml zstd advisory ignores give no reachability reason
- Severity: informational. In scope per SECURITY.md: no - tooling.
- Where:
deny.toml:28-30(RUSTSEC-2026-0391,-0398,-0403). - What: read from the registry sources, no vulnerable entry point is reached -
0391needsstream::raw::*::with_context,0398theseekablefeature,0403legacy- but the ignores say only that DataFusion pins the version, so a later bump that reaches one is hidden. Not checked with a full feature resolution. - Fix: a reason per advisory, and a check that
seekableandlegacystay off.
Not a security finding
A question with several metrics ordered by a guarded metric is refused with a placeholder-count mismatch on every dialect but Postgres (crates/sutura-sql/src/generate.rs:727-747, generate/top.rs:17-27). It fails closed; tracked in #1679.
🤖 Generated with Claude Code
Activity
test(catalog-wren): run the manifest bound cells on base
test(exec-datafusion): declare the Avro refusal cell as a claim
geoHeil commentedon Nov 1, 2026
Upstream issues filed for finding 1, with the owner's approval:
AvroScandecode arm panics without theavrofeature, which is off by default. The vendoreddatafusion-protopatch (1) carries the fix until this is resolved.create_worker_clienthard-codesusize::MAXmessage limits. This is the upstream half of the client decode cap in 1(a).Not filed yet, until CI on the vendoring branches has reproduced the panics, so each issue can paste the real output:
datafusion-proto-commonfrom_protopanic sites;arrow-ipcbuffer and decompression bounds.geoHeil commentedon Nov 1, 2026
Finding 1: the
datafusion-physical-plandecode panics (anUnnestrecursion with an unset column, anExplainplan with an unsetplan_type) are filed upstream as apache/datafusion#26999. #1703 tracks every upstream fix this finding waits on, and theproto-commonandarrow-ipcissues will be added there once their cells' red CI run shows the panic.fix(xtask): leave vendored code out of check-expect-thresholds
fix(exec-datafusion): refuse a peer's malformed Explain or Unnest
fix(nix): keep vendored crates real in the dependency build
fix(exec-datafusion): floor a peer reply's decode cap at 64 KiB
test(xtask): keep the vendor scope cell beside its gate
fix(exec-datafusion): refuse a peer's malformed stage, not panic
geoHeil commentedon Nov 2, 2026
Status, 2026-11-02.
Findings 2-10 are merged:
ClusterIssuerrefusal; task grantFinding 1, merged: the
AvroScanarm (#1690), theUnnest/Explainunwraps (#1710), thedatafusion-proto-commonpanics (#1719), the server's decode cap (#1695), and the client's decode cap (#1715).Finding 1, still open:
arrow-ipc59.2.0, vendored. It backports fix(arrow-ipc): return an error instead of panicking on out-of-bounds IPC buffers apache/arrow-rs#11881 and #10959, and bounds the declared uncompressed length. This is in progress. The test-only commit goes first, so CI records the failure the upstream issue will quote.FlightDatastream decode. It starts afterarrow-ipclands.The upstream waits are tracked in #1703. This issue stays open until both items above land.
test(exec-datafusion): let CI reach the peer IPC cells
build(deps): vendor arrow-ipc 59.2.0 unchanged
fix(deps): refuse a peer's malformed Arrow IPC, not panic or abort
test(deps): add the arrow-ipc claim cells' killing mutations
chore: bring origin/main into the arrow-ipc stack
docs(vendor): name arrow-flight callers fb_to_schema still panics in
test(vendor): kill the validity-buffer claim cells by their assertion
geoHeil commentedon Nov 2, 2026
Closing. The two items the 2026-11-02 status left open have both merged:
arrow-ipc59.2.0, vendored and bounded: fix(flight): refuse a peer's Arrow IPC that panics or aborts a node #1721. It backports fix(arrow-ipc): return an error instead of panicking on out-of-bounds IPC buffers apache/arrow-rs#11881 and #10959, and bounds the declared uncompressed length. The upstream issue is arrow-ipc: a sender-declared uncompressed length sizes an up-front allocation, aborting on i64::MAX apache/arrow-rs#12030.peer_stage(a worker's decode of a coordinator-sent stage) andleg_frames(a remote leg'sFlightDatastream).leg_framesdispatch (run 41443564247) found a peer frame whose validity buffer is shorter than its node, which panics inarrow-data59.2.0. fix(vendor): refuse an IPC validity buffer shorter than its node #1728 refuses that frame in the vendored reader. Upstream fixed it in Return errors for undersized ArrayData validity buffers apache/arrow-rs#11044 and #11658, but no 59.x release carries either.868e62832(run 41459034249), all eight targets pass.leg_framesran 341,445 executions in 61 seconds with no crash.Findings 1-10 are all merged. What stays open is upstream only, and #1703 tracks it: apache/datafusion#26998, #26999, #27004; datafusion-contrib/datafusion-distributed#828; apache/arrow-rs#12030. Removing each vendored patch waits on its release.
Limits:
peer_stageharness rebuilds the worker's decode from public parts, and nothing checks that it stays in step with the worker's own session.