Skip to content

Unbounded WatchSandbox sandbox_id #27

@pimlock

Description

@pimlock

Summary

WatchSandbox takes a sandbox id from the request and uses it as the key for the tracing log bus. The bus creates one broadcast channel and one tail deque per distinct sandbox_id. There is no check that the id corresponds to an existing sandbox, and when the stream ends, the bus does not remove the channel or deque. A client can open many streams with different fake ids; each creates a new entry in the bus's internal maps. Over time this can grow without bound and exhaust memory or file descriptors.

Source Code

  • In crates/navigator-server/src/grpc.rs, watch_sandbox (lines 156-164) sets sandbox_id = req.id.clone() after checking only that req.id is non-empty. It does not verify that the sandbox exists.
  • In crates/navigator-server/src/tracing_bus.rs, sender_for(sandbox_id) (lines 59-69) does per_id.entry(sandbox_id.to_string()).or_insert_with(|| broadcast::channel(1024)). The publish method (lines 87-97) does tails.entry(sandbox_id.to_string()).or_default(). There is no cleanup when a subscriber drops.

Originally by @drew on 2026-02-19T09:00:48.684-08:00

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions