Skip to content

e2b: directory watches ignore the requested user #83

Description

@sweetcornna

What happened

Both official E2B SDKs send the filesystem watch user through Basic authorization, but neither Dormice watch route reads or validates that identity. The watcher executor has no user parameter and starts every watcher as the default user.

Reproduction:

  1. Start a Docker sandbox through an official E2B SDK.
  2. Call watchDir('/root', callback, { user: 'root' }) (or Python watch_dir('/root', user='root')).
  3. Observe watcher startup fail on permissions even though root was requested.

A second focused check is to request an unsupported username. Other filesystem operations reject it, while the watch request is accepted and silently runs as the default user whenever the path is accessible.

Expected: The watch runs as the requested supported user, and unsupported usernames are rejected consistently with other filesystem operations.

Actual: The authorization header is ignored and every watch runs as user.

Impact: Root watches of root-only trees fail, and permission-sensitive applications can establish a watch under a different identity from the one they requested, missing expected events.

Relevant code and contract:

  • packages/server/src/e2b/envd/watch.ts:105-168 starts streaming watches without extracting or validating the username; 235-263 does the same for polling watches.
  • packages/server/src/executor/executor.ts:563-574 states that watchDir has no user option and always runs as user.
  • packages/server/src/executor/docker.ts:1164-1210 starts inotifywait without a container user.
  • e2b 2.31.0 makes WatchOpts extend FilesystemRequestOpts and sends authenticationHeader(..., opts.user); Python 2.31.0 exposes watch_dir(..., user=...) and sends the same authentication header.

dor doctor output

Not applicable — this is an E2B watch protocol/identity mismatch, not a host-readiness failure.

Environment

  • Dormice commit: 4417ae14938273f5d937c476cf7cdc57e22e53a5
  • SDKs checked: e2b JavaScript and Python 2.31.0
  • Executor: Docker + gVisor; route behavior also traceable with the fake executor
  • Verification: official SDK wire trace and server/executor identity trace

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions