Skip to content

fix(server): require sandbox identity metadata for provider env RPC#343

Closed
drew wants to merge 1 commit intoNVIDIA:mainfrom
vincentkoc:codex/fix-unauthenticated-rpc-leaking-credentials
Closed

fix(server): require sandbox identity metadata for provider env RPC#343
drew wants to merge 1 commit intoNVIDIA:mainfrom
vincentkoc:codex/fix-unauthenticated-rpc-leaking-credentials

Conversation

@drew
Copy link
Collaborator

@drew drew commented Mar 16, 2026

Motivation

  • The GetSandboxProviderEnvironment RPC previously returned provider credential key/value pairs for any caller-supplied sandbox_id with no caller identity binding, allowing unauthenticated clients to exfiltrate secrets.
  • The intent of the change is to ensure credential material can only be retrieved by the sandbox that owns the requested sandbox_id by binding the request to the caller identity.

Description

  • Add a shared metadata key constant HEADER_SANDBOX_ID ("x-sandbox-id") to bind requests to a sandbox identity.
  • Implement authorize_sandbox_request(request, sandbox_id) which validates presence of the x-sandbox-id metadata and enforces it equals the requested sandbox_id.
  • Enforce the authorization check at the start of get_sandbox_provider_environment so no sandbox or provider lookups occur for unauthorized callers.
  • Add focused unit tests exercising authorize_sandbox_request for matching metadata, missing metadata, and mismatched sandbox_id cases and expose the helper in the test import list.

Testing

  • Ran cargo test -p openshell-server authorize_sandbox_request -- --nocapture and the three new authorization tests passed (3 passed; 0 failed).
  • Ran cargo fmt --all to format changes (succeeded in this environment).
  • Attempted mise run pre-commit but it failed in this environment due to remote tool resolution / trust restrictions (not a code failure).

Codex Task

@drew drew added integration:aardvark Aardvark integration integration:codex Codex integration labels Mar 16, 2026
@github-actions
Copy link

Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text:


I have read the DCO document and I hereby sign the DCO.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

@johntmyers
Copy link
Collaborator

Closing in favor of consolidated re-implementation. See #350 for tracking.

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

Labels

integration:aardvark Aardvark integration integration:codex Codex integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants