[Bug]: V2 adapter does not wire a permission authorizer — pty tools bypass permission.bash (deny/ask) rules
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 46/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- bun, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.)
- Lenguaje dominante
- TypeScript
- Estrellas
- 597
- Forks
- 65
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 3
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de shekohex/opencode-pty
-
[Bug]: exit notification delivery failures are silently swallowed — agent never wakes, no diagnosticAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
shekohex/opencode-pty#54 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
shekohex/opencode-pty#48 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
shekohex/opencode-pty#83 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
shekohex/opencode-pty#82 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
shekohex/opencode-pty#81 ·
Los mantenedores suelen responder en 1 día
Todos los issues de shekohex/opencode-pty
Issues similares
-
afk-ok area:data-quality importer size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
enorm-labs/event-junkie#3301 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
one-zero-eight/apply-bot#39 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bigbluebutton/bbb-ui-components-react#108 ·
Los mantenedores suelen responder en 2 días
-
area: app type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
ExpidetGames/code-reviewer#308 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día