anthropics / anthropics/claude-code

[Bug] Permission check incorrectly rejects fully qualified paths in `cmd /c` commands

Abierto
#94,234 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:bash area:permissions bug platform:windows
Lenguaje dominante
Python
Estrellas
145k
Forks
23.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

**Bug Description**
The permission check appears to incorrectly reject commands that use fully qualified absolute paths when they are executed through `cmd /c`.

For example, Claude Code generated:

`cd "D:\\" && cmd /c ""D:\\\gradlew.bat" build" 2>&1`

The path to `gradlew.bat` is fully qualified and clearly resides inside the working directory. There are no relative paths involved.

Nevertheless, Claude Code reports:

`cmd names a path that is computed at run time, which cannot be checked against the read block (permissions.blockReadsOutsideWorkingDirectories)`

This seems overly conservative and misleading. The permission system should be able to resolve the absolute path passed to `cmd /c` and verify that it is within the allowed working directory.

The error message is especially confusing because it refers to `cmd` as naming a runtime-computed path, even though the actual target path is explicitly specified as an absolute path in the command.

This is particularly problematic on Windows, where invoking `.bat` files through `cmd /c` is a normal and legitimate execution pattern.

**Environment Info**
- Platform: win32
- Terminal: pycharm
- Version: 2.1.270
- Feedback ID: fb6eb062-f53b-439c-9d9a-69c7beff98ec

**Errors**
```json
[]
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Reproduce the reported command on win32, using the fully qualified gradlew.bat path through cmd /c. Trace the permission check for cmd /c commands and absolute paths, then verify that an in-directory path is accepted and that the misleading runtime-computed-path message no longer appears.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, shell
Área
cli, operating-systems, security
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.