Back to skill

Security audit

deepseek-harness-desktop-shell

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Electron wrapper guide, but it includes security-sensitive launch and local-service trust instructions that deserve manual review before use.

Review and modify the generated project before running it: preserve NODE_OPTIONS by default, authenticate or verify the local Harness service before loading it, keep preload/IPC APIs narrowly scoped and origin-checked, and pin Electron build dependencies with a lockfile. This does not appear malicious, but it should not be installed or used blindly in managed or security-sensitive environments.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/desktop-shell-prompt.md:20
Finding

Inherited Node.js Security Controls Are Explicitly Disabled

Content
View full analysis

Vulnerability Details

File Location: references/desktop-shell-prompt.md, lines 20-23
Vulnerability Type: Security-control bypass
Risk Level: Medium

Vulnerable Code

text
- 自动拉起时,用解析出的 `harnessHome` + `nodeBin` 拼出 CLI 命令:
  `NODE_OPTIONS="" "<nodeBin>" "<harnessHome>/apps/cli/lib/bin.js" web --port <port>`
  (保留 `NODE_OPTIONS=""` 以规避某些托管环境给 node 注入"安全删除"钩子、导致 Harness 写盘
  失败的问题;若该环境无此问题可省略,但需在 README 说明。具体钩子成因与边界见
  `deepseek-harness-windows-deploy` 技能的「安全与防护边界」。)

Technical Analysis

The Skill directs the generated wrapper to clear NODE_OPTIONS before launching DeepSeek Harness. It explicitly identifies the purpose as bypassing a security hook injected by some managed environments.

NODE_OPTIONS can contain organization- or platform-provided Node.js runtime controls, including preload modules, policy enforcement, monitoring, or filesystem protection. Clearing the entire variable removes every inherited option, not only a verified incompatible setting. This violates least privilege because an Electron wrapper does not inherently require the removal of managed runtime controls.

Although this does not grant administrator privileges, it can remove restrictions from the Harness process and all plugins loaded by that process. They would then operate with the full permissions of the current user.

Attack Path

  1. A managed environment supplies a protective module or policy through NODE_OPTIONS.
  2. The agent implements the documented launch command.
  3. The wrapper starts Harness with NODE_OPTIONS set to an empty value.
  4. The inherited protection is omitted from the Harness runtime.
  5. Harness or a loaded plugin performs filesystem or process operations that the removed control would otherwise have blocked.

Impact Assessment

The affected Harness process and its plugins may obtain unrestricted access to resources available to the current operating-system us ...[truncated 284 chars]

Remediation
View remediation

Remediation Suggestions

  • Preserve inherited NODE_OPTIONS by default.
  • Do not clear the complete variable merely to address an unidentified compatibility problem.
  • Diagnose the exact incompatible option and document why it is unsafe or incompatible.
  • If an override is essential, require explicit, informed user approval before changing the environment.
  • Remove only the verified incompatible option while retaining unrelated security and monitoring controls.
  • Display the original and proposed effective options to the user without exposing secrets.
  • Add a configuration switch that defaults to preserving the environment.
  • Document the permissions and protections lost when the override is enabled.
  • Prefer correcting Harness filesystem configuration or permissions instead of bypassing runtime protections.

T09 · Insecure Skill Coding Practices

Warning
Location
references/desktop-shell-prompt.md:25
Finding

Port Occupancy Is Treated as Proof of Harness Service Identity

Content
View full analysis

Vulnerability Details

File Location: references/desktop-shell-prompt.md, lines 25-26
Vulnerability Type: Unauthenticated local-service trust
Risk Level: Medium

Vulnerable Code

text
- 端口占用检测通用化:启动前探测 `port`,被占用则直接连接(视为已有 Harness 在跑),
  否则拉起。

The related preload guidance at lines 37-38 expands the potential impact:

text
- preload 仅暴露最小桥接 API(如:窗口最小化 / 关闭、打开外部链接、读写壳自己的
  `config.json`、读取版本号),不得劫持或改写 Harness 逻辑。

Technical Analysis

A listening TCP port only demonstrates that some process has bound the port. It does not establish that the process is a legitimate DeepSeek Harness instance. A local process can bind the configured loopback port before the wrapper starts and serve attacker-controlled web content.

Electron settings such as nodeIntegration: false and contextIsolation: true reduce direct renderer privileges, but they do not authenticate loaded content. The proposed preload API includes operations such as opening external links and reading or writing wrapper configuration. If generated IPC handlers do not validate the caller's origin and arguments, an impersonating local service could invoke those capabilities.

The documentation also requires same-origin Harness navigation to remain inside the wrapper. Content served by a process that captured the expected loopback origin could therefore be mistaken for trusted Harness content.

Attack Path

  1. An attacker-controlled process running in the same user context binds the configured loopback port before Harness starts.
  2. The Electron wrapper detects that the port is occupied.
  3. Following the Skill instructions, the wrapper assumes that Harness is already running and connects without authenticating it.
  4. The attacker's HTML and JavaScript execute in the renderer under the expected loopback origin.
  5. The page probes the preload bridge and IPC handlers.
  6. If configuration or external-link methods lack caller an ...[truncated 695 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not treat port occupancy as service authentication.
  • Add a dedicated Harness health endpoint that returns a verifiable application identifier and expected version.
  • Prefer a per-launch random authentication token passed securely to Harness and required by the wrapper.
  • Verify the exact protocol, hostname, port, and service response before loading content.
  • Fail closed when the service identity cannot be established; do not load arbitrary content from an occupied port.
  • Restrict navigation and new-window handling to an explicit origin allowlist.
  • Validate event.senderFrame.url or the equivalent caller identity in every privileged IPC handler.
  • Apply strict schemas and allowlists to all IPC arguments.
  • Avoid exposing configuration writes directly to renderer content. If required, expose narrowly scoped setters for approved fields only.
  • Store sensitive launch tokens outside page-accessible configuration and rotate them for each process launch.

T08 · Insecure Dependencies

Warning
Location
references/desktop-shell-prompt.md:67
Finding

Electron Build Dependencies Are Introduced Without Version or Integrity Controls

Content
View full analysis

Vulnerability Details

File Location: references/desktop-shell-prompt.md, lines 67-70
Vulnerability Type: Uncontrolled third-party dependency resolution
Risk Level: Medium

Vulnerable Code

text
- 脚手架:package.json(name 建议 `deepseek-harness-desktop`)、Electron、electron-builder;
  入口 `main.js` / `preload.js` / `index.html`(加载失败兜底页)。
- 主窗口 1280x800;应用图标占位 + 替换说明。
- 桌面体验:单实例锁(`app.requestSingleInstanceLock`)、F12 开 DevTools(仅开发模式)、
  可选最小化到托盘。
- 打包:Windows 产出 nsis / portable 的 `.exe`;scripts 含 `start` / `pack` / `dist`。

The Skill also states that npm must be able to install packages over the network, but it does not prescribe exact package versions, a committed lockfile, registry restrictions, integrity validation, or lifecycle-script controls.

Technical Analysis

Electron and electron-builder are build-time dependencies capable of executing code during installation and packaging. Without exact reviewed versions and a lockfile, dependency resolution can change over time and may include newly compromised releases or transitive dependencies.

The absence of a required trusted registry also leaves generated projects vulnerable to registry misconfiguration, dependency confusion, or similarly named package substitution. npm lifecycle scripts execute with the current user's permissions, so a compromised dependency can run before the application is built.

The audited package does not itself include a malicious dependency or executable package manifest. The issue is an insecure dependency-management instruction that would be propagated into projects generated from the Skill.

Attack Path

  1. An agent generates the requested package.json without exact reviewed versions or a lockfile.
  2. The user runs the instructed npm installation or packaging workflow.
  3. npm resolves packages and transitive dependencies from the configured registry.
  4. A compromised release, malicious substitute, or depend ...[truncated 632 chars]
Remediation
View remediation

Remediation Suggestions

  • Require exact, reviewed versions of Electron, electron-builder, and all other direct dependencies.
  • Generate and commit an npm lockfile.
  • Use npm ci for reproducible installation rather than unconstrained dependency resolution.
  • Configure npm to use an explicitly approved registry over HTTPS.
  • Review transitive dependencies and npm lifecycle scripts before installation.
  • Run npm audit or an equivalent software-composition analysis tool and triage its results.
  • Consider installing with lifecycle scripts disabled during verification, enabling only reviewed scripts when necessary.
  • Verify package provenance and integrity metadata where supported.
  • Perform builds in an isolated, minimally privileged environment without unrelated credentials.
  • Pin build tools in CI and define a controlled process for reviewing and updating versions.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill documentation is written entirely in Chinese and does not indicate that users or agents may choose another language. Under the policy, forcing a specific language without opt-in is a natural-language locale violation unless the constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language instructions are entirely in Chinese and do not indicate that the user can choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.