[Bug]: Opening a file on Windows spawns powershell -EncodedCommand, which AVG and Avast block as malware

Aperta Adatta ai principianti
#30,954 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à
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
67/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
electron, node.js, typescript
Ambito
desktop

Direzione di ricerca

Inizia nell’area dell’app desktop (apps/desktop) e segui il percorso con cui un clic su un link a un file locale invoca il pacchetto npm open su Windows. Verifica il comportamento di Electron’s shell.openPath() e il modo in cui l’app gestisce il risultato; il report lo identifica come la sostituzione suggerita. Il lavoro è completato quando i file locali si aprono nell’app predefinita senza avviare PowerShell con -EncodedCommand.

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

Descrizione

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/desktop

Steps to reproduce
  1. On Windows 11 with AVG (or Avast, same engine) and its Behavior Shield on, open T3 Code.
  2. In a thread, click a link to a local file (in my case a PDF in the workspace) so the app opens it in the default viewer.
Expected behavior

The file opens in its default app.

Actual behavior

The file does not open. AVG's Behavior Shield kills powershell.exe and shows "Threat secured: IDP.HELU.PSE96 - Command line detection", process C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe.

The cause is in the desktop bundle (resources/app.asar): files are opened with the open npm package, which on Windows spawns

powershell -NoProfile -NonInteractive –ExecutionPolicy Bypass -EncodedCommand <base64 of: Start "<path>">

An encoded command that also bypasses the execution policy is a classic malware pattern, so behavior-based antivirus engines flag it. Several AVG, Avast and Norton forum threads show the same IDP.HELU.PSE family firing on tools that spawn PowerShell this way.

Timing on my machine: Windows PowerShell 5.1 console start (Microsoft-Windows-PowerShell/Operational, event 40961) at 18:10:39, AVG detection at 18:10:49, no other detections that day. The file itself is clean.

Suggested fix: on Windows, open files with Electron's shell.openPath() (ShellExecute, no PowerShell process) instead of the open package.

Impact

Major degradation or frequent failure

Version or commit

T3 Code (Beta) desktop 0.1.7

Environment

Windows 11 Pro 10.0.26200, AVG Antivirus with Behavior Shield on

Logs or stack traces
AVG: Threat name IDP.HELU.PSE96 - Command line detection
     Process C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
     Detected by Behavior Shield, Status Blocked
Workaround

Open the file from File Explorer instead of clicking it in T3 Code.

Lingua principale
TypeScript
Stelle
24.8k
Fork
6.4k
Merge medio
13h 48m
PR unite (30g)
208

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 pingdotgg/t3code

Tutte le issue di pingdotgg/t3code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.