Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

openInEditor runs the editor command through a shell

Chiusa
#209 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
53/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
desktop, security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement priority: low security severity: low

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.

Lingua principale
TypeScript
Stelle
2
Fork
2
Merge medio
5h 28m
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PierrunoYT/patch

Tutte le issue di PierrunoYT/patch

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.