Skip to content

[BUG] Niubash / dsh-ops 运行时被 Windows Defender 误报并隔离的事件报告 #771

Closed

Description

@SuzukaWu

dsh-ops version and how it was installed

0.5.0(npm 包,随 desktop profile 用 pnpm 装的,无本地 tarball;pnpm-lock.yaml 里有 dsh-ops@0.5.0)

DSH version and profile

0.2.2-rc.1, profile=desktop

OS and architecture

Windows x64

Minimal reproduction

Call the shell tool in any DSH session (profile=desktop):

ops_bash({"command": "echo hi"})

Observed: EXECUTOR_UNAVAILABLE - the restricted Bash runtime could not be prepared:
UNKNOWN: unknown error, open 'C:\Users\Wu\.dsh\profiles\desktop\node_modules\dsh-ops\runtime\win32-x64\niubash\niu.exe'

Equivalent CLI reproduction (copy as-is, Windows PowerShell):

& 'C:\Users\Wu\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\node\bin\node.exe' 'C:\Users\Wu\.dsh\profiles\desktop\node_modules\dsh-ops\bin\dsh-ops.mjs' bash-runtime status

Actual output on 2026-11-07:

{
  "selected": {
    "available": false,
    "source": "bundled",
    "detail": "EXECUTOR_UNAVAILABLE: Niubash payload verification failed: Incomplete Niubash payload tree. Restore the complete pinned v1.5.0 portable tree; this is not a user authorization denial. Do not bypass confinement or fall back to another shell."
  },
  "engine": "none",
  "managed": [],
  "bashIpc": {
    "root": "C:\\Users\\Wu\\.dsh\\dsh-ops\\bash-ipc",
    "current": null,
    "generations": 0,
    "entries": [],
    "totalBytes": 0,
    "reclaimableBytes": 0
  }
}

Root cause (already confirmed): Windows Defender quarantined the payload file
C:\Users\Wu\.dsh\profiles\desktop\node_modules\dsh-ops\runtime\win32-x64\niubash\niu.exe
as Trojan:Win32/Bearfoos.A!ml (ThreatID 2147731250, false positive).
Provenance check: 158 expected files, 157 OK, 0 mismatched, 1 missing = niu.exe only.
Expected niu.exe sha256: 7ec3ec04ce91bae64c23d7150e6b16574e9d91df8fcf0df997006e2b37bf2f1e
Archive: niubash-v1.5.0-win-x64.tar.gz, sha256 da28cdc4e2e87f777ee0eae71386276f9c6a0ed135c1e2baad943acd8d349b87


---

Expected behaviour

bash-runtime status should report available: true and ops_bash should execute the command.

If a payload file is missing or quarantined by antivirus, the error should say so explicitly
(e.g. "niubash payload file niu.exe is missing - possibly quarantined by antivirus"),
name the exact file, and offer a supported repair path (reinstall/repair from the pinned
provenance and re-verify the SHA-256) instead of the generic
"UNKNOWN: unknown error, open ...". Users should not have to bypass Defender or any
confinement to recover.

如果页面上还有 "Bug description / Actual behaviour / Steps to reproduce" 之类的框

Bug description:
After Windows Defender quarantined the bundled Niubash payload file
(runtime\win32-x64\niubash\niu.exe) as a false positive, ops_bash fails on every call with
EXECUTOR_UNAVAILABLE: "Incomplete Niubash payload tree" / "UNKNOWN: unknown error, open ...
niu.exe". The rest of the payload tree is intact (157/158 files, 0 mismatched); only niu.exe
is missing. The error message does not mention antivirus quarantine or how to repair.

Steps to reproduce / Actual behaviour: see "Minimal reproduction" above.

Environment: see the required fields above.

Additional context:
- Full incident report attached (niubash_defender_false_positive_report_2026-11-07.md).
- Raw Defender events attached (evidence_raw.txt).
- Defender detection is a false positive: Trojan:Win32/Bearfoos.A!ml (ThreatID 2147731250,
  SeverityID 5), 3 detections on 2026-11-07, ActionSuccess=True, DidThreatExecute=False.
- The official archive SHA-256 matches the pinned provenance value; only niu.exe is missing,
  which is exactly the file Defender quarantined.
- Already filed/reported to Microsoft and to the Niubash upstream (links to be added).

Actual reading

$ "C:\Users\Wu\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\node\bin\node.exe" "C:\Users\Wu\.dsh\profiles\desktop\node_modules\dsh-ops\bin\dsh-ops.mjs" ladder --json
exit code: 0

{
  "worker": {
    "resolved": true,
    "executable": "C:\\Users\\Wu\\.dsh\\profiles\\desktop\\node_modules\\dsh-ops\\runtime\\win32-x64\\dsh-ops-worker.exe",
    "source": "packaged runtime",
    "error": null
  },
  "shells": {
    "bash": {
      "available": false,
      "executable": null,
      "source": "bundled",
      "detail": "EXECUTOR_UNAVAILABLE: Niubash payload verification failed: Incomplete Niubash payload tree. Restore the complete pinned v1.5.0 portable tree; this is not a user authorization denial. Do not bypass confinement or fall back to another shell.",
      "restricted": null,
      "integrity": {
        "status": "not-applicable",
        "entries": [],
        "warnings": []
      }
    },
    "pwsh": {
      "available": false,
      "executable": null,
      "source": "host",
      "detail": "PowerShell is managed by the host; OPS does not supply or override its executable. Use dsh-ops upgrade-host-pwsh on Windows, then restart DSH. An explicit host pwshPath remains authoritative."
    }
  },
  "levels": {
    "files": true,
    "bash": false,
    "pwsh": false
  },
  "rungs": []
}

$ "...dsh-ops.mjs" bash-runtime status
exit code: 0

{
  "selected": {
    "available": false,
    "source": "bundled",
    "detail": "EXECUTOR_UNAVAILABLE: Niubash payload verification failed: Incomplete Niubash payload tree. Restore the complete pinned v1.5.0 portable tree; this is not a user authorization denial. Do not bypass confinement or fall back to another shell."
  },
  "engine": "none",
  "managed": []
}

In a DSH session, calling the shell tool fails as well:

ops_bash({"command": "echo hi"})
-> EXECUTOR_UNAVAILABLE: the restricted Bash runtime could not be prepared:
   UNKNOWN: unknown error, open 'C:\Users\Wu\.dsh\profiles\desktop\node_modules\dsh-ops\runtime\win32-x64\niubash\niu.exe'


---

Reproduced in isolation?

Did not try isolation

Anything else (optional)

niubash_defender_false_positive_report_2026-11-07.md

evidence_raw.txt

Related issues/PRs: none found in this repo.

What we already ruled out:

  • Not an authorization denial - the error text says "this is not a user authorization denial".
  • Not a corrupted download or wrong archive: provenance check shows 158 expected files,
    157 OK, 0 mismatched; the only missing file is niu.exe, which is exactly the file
    Windows Defender quarantined.
  • Not a missing native worker: ladder --json shows worker.resolved=true with the packaged
    dsh-ops-worker.exe present.
  • Not a bash availability issue: Git Bash exists (C:\Program Files\Git\bin\bash.exe); the
    failure is dsh-ops' bundled payload tree, not the host bash.

Defender evidence (Get-MpThreatDetection / Get-MpThreat):

  • Trojan:Win32/Bearfoos.A!ml, ThreatID 2147731250, SeverityID 5, IsActive=False.
  • 3 detections on 2026-11-07: 17:09:05, 17:09:12 (runtime\win32-x64\niubash\niu.exe),
    and 18:08:22 (shells\niubash.stage-CmVXMQ\niu.exe); ActionSuccess=True, DidThreatExecute=False.
  • We did NOT disable Defender, did NOT add exclusions, did NOT restore from quarantine,
    and did NOT bypass the executor. This issue only asks for a clearer diagnostic and a
    supported repair path.

Proxy/mirror environment: this machine accesses GitHub through a local proxy
(127.0.0.1:20809) because direct TLS is intercepted in this network. That is unrelated to
the local payload files; all reproduction above is local/offline.

Full report and raw evidence attached below.

Activity

  1. latte03 commented on Nov 7, 2026

    @latte03

    +1

  2. dagangwo commented on Nov 8, 2026

    @dagangwo

    一样啊更新到0.5以后dsh一调用ops就会被当做木马病毒杀掉,你是真有病毒还是一堆证书exe啊,解决一下,要不没法用

  3. Yifumoe commented on Nov 8, 2026

    @Yifumoe

    Image +1被eset杀了

  4. arookieofc commented on Nov 17, 2026

    @arookieofc
    74106bd7f632ba64a492bceba030ec95 我们已经申请证书一个月了,还是没有下发,再等等吧
  5. Thatgfsj commented on Nov 20, 2026

    @Thatgfsj
    Collaborator

    #1033(main c70633da)收下了本单要求的可操作处置:docs/troubleshooting.md:250「Antivirus quarantined niu.exe from the payload」,docs/CHANGELOG.md 同步记录。

    本单期望的三件事在 main 上都已成立:

    隔离本身是外部安全产品的决定,仓库侧能交付的「说清是隔离、点名文件、给出修复路径」三项均已落地。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions