bug(boundary): CA bundle JSON serialization inflates control frame past 1MB limit on macOS
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- backend, backend-api-design
Hướng nghiên cứu
Bắt đầu trong openshell-sandbox-backend/src/boundary_protocol.rs, xem xét MAX_CONTROL_FRAME_BYTES ở dòng 35, Request::StartAgent khoảng dòng 534 và encode_frame khoảng các dòng 1092–1096. Tái hiện frame quá lớn với macOS CA bundle, sau đó xác minh rằng ca_bundle và ca_cert sử dụng cách mã hóa gọn hơn, serialization cũ được xử lý đúng cách và giới hạn 1MB vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
User Story
As a developer running the VM compute driver on macOS,
I want sandbox creation to succeed without hitting boundary protocol frame size limits,
so that I can use VM-backed sandboxes on machines with standard macOS system CA bundles.
Problem Statement
The StartAgent boundary control request fails with control frame is too large when the host system CA bundle exceeds ~300KB. The ca_bundle field in Request::StartAgent is typed as Option<Vec<u8>> and serialized via serde's default JSON encoding, which represents each byte as a decimal number in a JSON array ([45, 45, 45, 10, ...]). This inflates the payload ~3.3× compared to the raw bytes. A typical macOS system CA bundle is
~334KB, which serializes to ~1.1MB of JSON — exceeding the MAX_CONTROL_FRAME_BYTES limit of 1MB (1,048,576 bytes).
The supervisor attaches and confirms the isolation boundary successfully, but crashes when encoding the StartAgent request that carries the CA bundle to the guest.
Impact / Why This Matters
When this happens, every openshell sandbox create on the affected machine fails after completing image pull and boundary attachment. The supervisor exits with status 1 and the sandbox enters an error phase. Users see:
Error: process error: encode control request: control frame is too large: 1099704 bytes
There is no workaround short of patching the frame size limit or trimming the system CA store. This blocks all VM-backed sandbox usage on macOS systems with default certificate stores. The issue is latent on Linux as well / any system with a CA bundle above ~300KB will hit it.
Acceptance Criteria
-
openshell sandbox createsucceeds on macOS with the default system CA bundle (300–400KB on my computer) - The
ca_bundleandca_certfields inRequest::StartAgentuse a space-efficient serialization (e.g., base64) instead of JSON byte arrays - Existing supervisor and sandbox binaries using the old serialization format are handled gracefully (protocol versioning or backwards-compatible encoding)
- The
MAX_CONTROL_FRAME_BYTESlimit remains a meaningful safety bound (not raised to paper over the encoding inefficiency)
Reproduction Steps
- Run the gateway with VM compute driver on macOS:
openshell-gateway --config gateway.toml --compute-driver vm - Create a sandbox:
openshell sandbox create - Observe the supervisor error in the sandbox error output:
Error: process error: encode control request: control frame is too large: 1099704 bytes - Verify the system CA bundle size:
ls -la ~/.local/state/openshell/vm-driver/sandboxes/<id>/proxy-tls/ca-bundle.pem~334KB on my macOS
Environment
- OpenShell: (development build from main)
- OS: macOS 26, Apple Silicon (arm64)
- Runtime: VM compute driver (libkrun, Apple Hypervisor.framework)
- CA bundle size: 334,127 bytes (default macOS system trust store)
Logs
2026-09-17T17:01:55.036Z INFO openshell_supervisor: Starting sandbox supervision
2026-09-17T17:01:55.107Z INFO openshell_supervisor: Isolation boundary attached
2026-09-17T17:01:55.108Z INFO openshell_supervisor: Isolation boundary enforcement confirmed
2026-09-17T17:01:55.121Z OCSF CONFIG:ENABLED [INFO] TLS termination enabled: ephemeral CA generated
2026-09-17T17:01:55.122Z OCSF CONFIG:READY [INFO] Policy DNS connected to isolation boundary
2026-09-17T17:01:55.122Z OCSF NET:LISTEN [INFO] 127.0.0.1:3128
2026-09-17T17:01:55.130Z OCSF CONFIG:LOADED [INFO] Acknowledged initial policy revision as loaded
Error: × process error: encode control request: control frame is too large: 1099704 bytes
Relevant code path: `openshell-sandbox-backend/src/boundary_protocol.rs:35` defines `MAX_CONTROL_FRAME_BYTES = 1024 * 1024`. The `encode_frame` function at line 1092–1096 rejects any serialized payload exceeding this limit. The `ca_bundle: Option<Vec<u8>>` field at `boundary_protocol.rs:534` uses serde's default `Vec<u8>` → JSON array encoding.
Relevant code path: `openshell-sandbox-backend/src/boundary_protocol.rs:35` defines `MAX_CONTROL_FRAME_BYTES = 1024 * 1024`. The `encode_frame` function at line 1092–1096 rejects any serialized payload exceeding this limit. The `ca_bundle: Option<Vec<u8>>` field at `boundary_protocol.rs:534` uses serde's default `Vec<u8>` → JSON array encoding.
- Ngôn ngữ chính
- Rust
- Star
- 8.7k
- Fork
- 1.3k
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 271
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/OpenShell
-
area:docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
state:triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
area:cli state:validated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
state:triage-needed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
area:build spike state:review-ready state:stale
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
Tất cả issue của NVIDIA/OpenShell
Issue tương tự
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
n0-computer/iroh#4550 ·
-
impl detach for native Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
paritytech/zombienet-sdk#591 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
farion1231/cc-switch#7638 · 1 bình luận ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100