[Bug]: V2 adapter does not wire a permission authorizer — pty tools bypass permission.bash (deny/ask) rules
Maintainer thường phản hồi trong vòng 1 ngày
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
- 46/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ệ
- bun, typescript
Hướng nghiên cứu
Read the V2 adapter creation and host adapter installation paths, then compare them with V1PermissionAuthorizer and the checkCommandPermission / checkWorkdirPermission defaults. Trace how V2 exposes permission configuration and identify tests covering deny and ask rules for PTY commands. Done means V2 PTY commands follow the configured permission rules, with tests confirming the behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
In v0.4.0's V2 entrypoint, the PTY tools (pty_spawn, pty_write, ...) execute without consulting OpenCode V2's permission configuration. In V1 host mode the plugin honored permission.bash via its V1PermissionAuthorizer; the V2 wiring omits an equivalent authorizer entirely, so deny / ask rules are bypassable on the pty path.
Evidence (source inspection of the published 0.4.0 package)
createV2Adapter({ notifier })constructs the V2 adapter withoutV2AdapterOptions.permissions.installHostAdapteronly installs a permission authorizer when one is provided (truthy); the default is none.checkCommandPermission/checkWorkdirPermissiondefault to ALLOW when no authorizer is wired.- By contrast, the V1 path implements exactly this enforcement (
V1PermissionAuthorizerhonorspermission.bash, andaskgates are treated as denied in agent-driven use) — so this looks like an omission in the V2 wiring rather than an intentional design change.
Impact
With a config such as:
"permission": {
"bash": { "*": "ask", "sudo *": "deny", "rm -rf *": "deny", "*curl*|*sh*": "deny" }
}
commands spawned via pty_spawn / pty_write are not checked against these rules, silently weakening the security posture for users who rely on deny rules for destructive commands.
Suggested fix
Wire OpenCode's V2 permission API into the V2 adapter with the same semantics as the V1 authorizer (consult permission.bash for spawned commands; treat ask as denied in agent-driven use or surface an approval flow).
Environment
opencode-pty 0.4.0 · OpenCode v2.0.26 (V2 plugin runtime). Found during a dependency audit via source inspection of the published package — not a live exploit test. (Related but distinct from #67, which covers the separate V1-default-entrypoint load failure.)
- Ngôn ngữ chính
- TypeScript
- Star
- 601
- Fork
- 66
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 shekohex/opencode-pty
-
[Bug]: exit notification delivery failures are silently swallowed — agent never wakes, no diagnosticĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
shekohex/opencode-pty#54 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
shekohex/opencode-pty#48 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
shekohex/opencode-pty#83 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
shekohex/opencode-pty#82 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
shekohex/opencode-pty#81 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của shekohex/opencode-pty
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
QuantumNous/new-api#7839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug p2 triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getpaseo/paseo#7071 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test: make the #3408 Claude OAuth token fixture obviously fake so secret scanners stop flagging itĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
code-yeongyu/senpi#3436 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
lingdojo/kana-dojo#32505 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày