makecindy / makecindy/cindy

[Bug][Windows 启动安全兼容] 360 安全卫士拦截 Cindy 启动期 PowerShell

Open
#215 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

## 现象

在 Windows 安装并运行 360 安全卫士后,启动 Cindy 时弹出风险程序拦截提示:

- 被拦截程序:`C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe`
- 风险类型:PowerShell 命令执行攻击
- 截图时间:2026-07-22 15:16

360 测试记录显示:

- 下载:通过
- 安装:通过
- 启动:不通过
- 对话:通过
- 重启:通过
- 卸载:通过
- 扫描查杀:通过

Microsoft Defender、火绒、腾讯电脑管家、金山毒霸、瑞星、Avast、Avira、卡巴斯基的启动项测试均记录为通过。

原始记录未提供具体 Windows 版本、设备型号、360 客户端版本及病毒库版本,后续需要补充。

## 复现步骤

1. 在 Windows 设备上安装 Cindy。
2. 安装并启用 360 安全卫士。
3. 启动 Cindy。
4. 观察 360 弹出的风险程序拦截提示。
5. 记录被拦截进程路径、风险类型、360 版本和病毒库版本。
6. 对比关闭 360 防护或暂时放行后的启动结果。

## 期望行为

- Cindy 正常启动。
- 启动流程不应被安全软件误判为 PowerShell 命令执行攻击。
- 如确需执行系统维护命令,应尽量减少 PowerShell 调用,并使调用目的、参数和执行范围可识别、可审计。
- 不能因安全软件拦截导致应用无法启动或启动流程中断。

## 实际行为

- 360 安全卫士在 Cindy 启动阶段拦截 `powershell.exe`。
- 360 将该行为识别为“PowerShell 命令执行攻击”。
- 360 测试表中 Cindy 启动项判定为不通过。
- 当前尚未确认 360 拦截的是启动早期的孤儿 PowerShell 扫描,还是 Windows 快捷方式清理逻辑,或两者均可能触发。

## 源码分析

最新代码中确认存在以下 Windows 启动期 PowerShell 调用:

1. 启动早期会执行 Claude orphan PowerShell 扫描:

`apps/desktop/src/main/bootstrap-electron.ts:880-887`

2. Windows `ready` 阶段会无条件执行快捷方式清理:

`apps/desktop/src/main/bootstrap-electron.ts:5004-5055`

该逻辑包含:

- `powershell.exe`
- `New-Object -ComObject WScript.Shell`
- `Get-ChildItem -Recurse -Filter *.lnk`
- `Remove-Item -LiteralPath ... -Force`

3. 快捷方式清理函数在 Windows `ready` 阶段被调用:

`apps/desktop/src/main/bootstrap-electron.ts:5139-5142`

基于现有证据,启动阶段确实存在 PowerShell 进程扫描及快捷方式解析/删除行为,与 360 报告的 PowerShell 风险拦截具有关联性,但当前还不能仅凭静态代码确定具体触发点。

需要通过 A/B 验证分别禁用以下路径:

- Claude orphan PowerShell 扫描;
- Windows 快捷方式清理;
- 两者同时禁用。

同时记录 360 的拦截事件详情,确认触发命令、父进程、命令行参数和触发时间。

## 验收标准

- [ ] 在与原始问题相同或等效的 360 版本、病毒库版本和 Windows 环境下,Cindy 可以正常启动。
- [ ] 启动过程中不再出现 360 对 Cindy 内部 PowerShell 调用的风险拦截。
- [ ] 完成 A/B 验证,明确定位 orphan 扫描与快捷方式清理的具体触发关系。
- [ ] 不影响 Claude orphan 进程清理、快捷方式清理及正常启动流程的原有业务目标。
- [ ] Windows 启动、重启、对话、卸载和升级流程回归通过。
- [ ] 至少补充一个 Windows 自动化回归测试或明确记录无法自动化的原因及手工验证路径。
- [ ] 补充受影响 Windows 版本、设备型号、360 客户端版本、病毒库版本和测试包版本。
- [ ] 其他主流安全软件的启动兼容性保持通过。

Contributor guide

Open the contributing guide

Research direction

Start in apps/desktop/src/main/bootstrap-electron.ts at lines 880-887 and 5004-5055, then inspect the call at 5139-5142. Run an A/B comparison with the orphan scan and shortcut cleanup disabled separately and together, recording 360's process details. Done means the trigger is identified, startup still works, and Windows regression coverage or a documented manual path is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, powershell, typescript
Domain
desktop, security, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.