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

オープン 初心者向け
#30,954 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
67/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
electron, node.js, typescript
領域
desktop

調査の方向性

デスクトップアプリの領域(apps/desktop)から始め、ローカルファイルへのリンクをクリックしたときに Windows で npm パッケージ open がどのように呼び出されるかを追跡してください。Electron’s shell.openPath() の動作と、アプリがその結果をどのように処理するかを確認してください。レポートでは、これが推奨される置き換え先として特定されています。PowerShell を -EncodedCommand 付きで起動せずに、ローカルファイルが既定のアプリで開くようになれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
24.8k
フォーク
6.4k
平均マージ
13時間 48分
マージ済み PR(30日)
208

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pingdotgg/t3code のほかの issue

pingdotgg/t3code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。