openInEditor runs the editor command through a shell
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 53/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
Línea de trabajo
Start with src/main/files.ts:58 and read how openInEditor constructs and launches the editor command; then inspect the related Windows launcher constraint in issue #178. Add tests covering editor commands with spaces in paths and with arguments, as proposed. Done means editor commands are launched without treating the command as shell text, with the Windows .cmd case handled.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
From Finding 4b of the earlier SECURITY-REVIEW.md (also noted in the Oct 7 audit), checked against the current code.
Problem
openInEditor (src/main/files.ts:58) runs spawn(\${command} "${file}"`, { shell: true }). The file path is confined to the project and filtered for quotes, line breaks and (on POSIX) $, backtick and `. But editorCommand itself is shell text, so code; <anything> runs. Changing it needs a native confirmation, so this is not exploitable without the user, but the shell string is a fragile sink at the same trust level as the terminal.
Proposal
Split editorCommand into a program and arguments (shell-style parsing), and run spawn(program, [...args, file], { shell: false }). On Windows, .cmd launchers such as code.cmd need resolving to the executable or an explicit cmd.exe /d /s /c call with quoted arguments (see #178 for the same Node.js restriction). Add tests for editor commands with spaces in paths and with arguments.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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.
Issues similares
-
area:cards enhancement ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
fil-donadoni/tolaria#8883 ·
Los mantenedores suelen responder en 1 día
-
xsd:integer cast from a string rejects negative numbers, a leading + and surrounding whitespaceAbiertobug 🐛
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
comunica/comunica#1960 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Waiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
getsentry/sentry-javascript#26203 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bytedance/flowgram.ai#1235 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
devswha/herdr-web-ui#3325 ·