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

Đang mở Phù hợp với người mới
#30,954 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
67/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
electron, node.js, typescript
Lĩnh vực
desktop

Hướng nghiên cứu

Bắt đầu trong khu vực ứng dụng desktop (apps/desktop) và lần theo cách nhấp vào liên kết tệp cục bộ gọi gói npm open trên Windows. Kiểm tra hành vi của Electron’s shell.openPath() và cách ứng dụng xử lý kết quả; báo cáo xác định đây là phương án thay thế được đề xuất. Hoàn thành khi các tệp cục bộ mở bằng ứng dụng mặc định mà không khởi chạy PowerShell với -EncodedCommand.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
24.8k
Fork
6.4k
Merge trung bình
13 giờ 48 phút
Pull request đã merge (30 ngày)
208

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingdotgg/t3code

Tất cả issue của pingdotgg/t3code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.