Skip to content

fix(sandbox): verify a sandbox's identity before sending a token#124

Open
jedisct1 wants to merge 10 commits into
BunnyWay:mainfrom
dip-proto:sshhostkey
Open

fix(sandbox): verify a sandbox's identity before sending a token#124
jedisct1 wants to merge 10 commits into
BunnyWay:mainfrom
dip-proto:sshhostkey

Conversation

@jedisct1

Copy link
Copy Markdown
Contributor

Connecting to a sandbox sent its acccess token to whatever server answered, without first checking the server was really the sandbox.

Anyone able to intercept the connection could pose as the sandbox, get the token and use it to reach the real sandbox. Not great.

Fix that by remembering each sandbox the first time it connects, and checking that identity on later connections.

Both when using the command line and through the SDK.

This stays mostly invisible in practice: the trusted identities are stored in ~/.config/bunny/sandbox_known_hosts, which is filled in automatically on first contact, including when a sandbox is created.

Connecting to a sandbox sent its acccess token to whatever server
answered, without first checking the server was really the sandbox.

Anyone able to intercept the connection could pose as the sandbox,
get the token and use it to reach the real sandbox. Not great.

Fix that by remembering each sandbox the first time it connects,
and checking that identity on later connections.

Both when using the command line and through the SDK.

This stays mostly invisible in practice: the trusted identities
are stored in ~/.config/bunny/sandbox_known_hosts, which is filled
in automatically on first contact, including when a sandbox is
created.
@bogdan-at-bunny

Copy link
Copy Markdown

@codex review

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9651b16

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@bunny.net/sandbox Patch
@bunny.net/cli Patch
@bunny.net/cli-linux-x64 Patch
@bunny.net/cli-linux-arm64 Patch
@bunny.net/cli-darwin-x64 Patch
@bunny.net/cli-darwin-arm64 Patch
@bunny.net/cli-windows-x64 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e6dbb5786

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/sandbox/src/known-hosts.ts Outdated
Comment thread packages/sandbox/src/known-hosts.ts Outdated
Comment thread packages/sandbox/src/known-hosts.ts Outdated

@jamie-at-bunny jamie-at-bunny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Thank you so much for the contribution @jedisct1, great you found what's upcoming 😄

@amir-at-bunny I'll leave this to you to review and merge.

@amir-at-bunny amir-at-bunny left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jedisct1 thank you so much for the contribution! :) left some comments.

Comment thread packages/cli/src/commands/sandbox/ssh-exec.ts Outdated
Comment thread packages/cli/src/commands/sandbox/ssh-exec.ts Outdated
Comment thread packages/sandbox/src/transport.ts Outdated
jedisct1 added 4 commits July 13, 2026 16:58
* main:
  feat(sandbox): runCommand timeout/AbortSignal and file ops (BunnyWay#122)

# Conflicts:
#	packages/sandbox/src/errors.ts
#	packages/sandbox/src/index.ts
#	packages/sandbox/src/transport.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants