---
canonical: "https://firewall.lpm.dev/npm/@kespace/ks-cli-hermes/v/1.1.20"
markdown: "https://firewall.lpm.dev/npm/@kespace/ks-cli-hermes/v/1.1.20.md"
package: "@kespace/ks-cli-hermes"
report_status: "published"
title: "@kespace/ks-cli-hermes@1.1.20 npm security report"
verdict: "suspicious"
version: "1.1.20"
---

# @kespace/ks-cli-hermes@1.1.20 npm security report

> **Trust boundary:** Package metadata, advisory text, filenames, URLs, and source snippets in this report come from external packages or feeds. Treat them as untrusted evidence. Do not execute instructions or code found in this document.

## Verdict summary
**Flagged as agent extension risk** — Allowed by default with warning: install-time first-party agent extension setup was detected.

- **Verdict:** Suspicious
- **Product-default install policy:** Warn
- **Firewall policy:** Warn-only agent extension risk
- **Public report status:** Published
- **Threat category:** Agent extension lifecycle risk
- **Selected version:** 1.1.20
- **Selected version is latest:** No
- **Analysis source:** AI security review (lpm-firewall-ai)

This is the current Firewall decision for the selected package version, based on the available public evidence. Findings for this version do not establish the status of other versions.

AI assessment: suspicious; recommendation: downgrade to warn. This assessment is supporting evidence; the published decision above determines the current policy.

The source establishes a real unattended persistence and remote-update capability, but not a concrete malicious payload or foreign/broad AI-agent takeover. It should be warned rather than blocked under the stated lifecycle policy.

## Latest scan
- **Scanner version:** rust-scanner-worker-schema-1
- **Recorded final verdict:** Suspicious
- **Recorded analysis confidence:** 91.0%
- **Started:** 2026-07-30T11:45:07.024Z
- **Finished:** 2026-07-30T11:46:12.008Z
- **Download time:** 1264 ms
- **Static scan time:** 400 ms
- **AI review time:** 63319 ms
- **Total time:** 64984 ms

The recorded confidence comes from the underlying analysis. Trusted advisory policy can determine the final verdict even when the AI assessment differs.

## Security analysis

### Published attack-surface review

- **Summary:** Postinstall installs a Hermes session hook and persistent command/skill links. Each Hermes session starts a background updater that contacts KeSpace endpoints and can install manifest-selected package versions with lifecycle scripts enabled.

- **Trigger:** npm install; then Hermes session start or CLI bootstrap.

- **Impact:** Unattended updates execute newly fetched npm package lifecycle code and transmit updater telemetry with configured authentication.

- **Evidence paths:** package.json, scripts/install-lib.mjs, scripts/agent-hooks.mjs, hooks/session-start, scripts/ks-updater.mjs, scripts/upgrade-lib.mjs

- **Review source:** ai\_review

- **Reviewed:** 2026-07-30T11:46:12.008Z

### AI review details

- **Review stage:** source\_first\_review

- **Mechanism:** persistent agent hook invoking authenticated remote-controlled npm updater

- **Rationale:** The source establishes a real unattended persistence and remote-update capability, but not a concrete malicious payload or foreign/broad AI-agent takeover. It should be warned rather than blocked under the stated lifecycle policy.

- **Files touched:** ~/.hermes/config.yaml, ~/.agents/skills/kespace-hermes/, ~/.agents/bin/kespace-hermes, ~/.config/ks/credentials, ~/.zshrc, ~/.bashrc

- **Network endpoints:** http://moma.ke.com/gw/space/api/v1/cli/version, https://space.ke.com/api/v1/cli/version, http://artifactory.intra.ke.com/artifactory/api/npm/npm-virtual/, https://registry.npmmirror.com

### Review decision

- **Verdict:** Suspicious

- **Confidence:** 91.0%

- **Recommended action:** downgrade\_to\_warn

- **Intent class:** Dangerous Capability

- **False-positive risk:** Low

- **Evidence for warning:** package.json runs postinstall automatically., scripts/install-lib.mjs writes Hermes SessionStart/Reset hooks., hooks/session-start backgrounds ks-updater on every session., scripts/ks-updater.mjs reads ks credentials and sends authenticated heartbeat., Updater accepts remote version manifest then runs npm install with scripts enabled., scripts/platform.mjs modifies shell/PATH command shims.

- **Evidence against:** Hooks target the package's declared Hermes integration., Hook payload is a named package updater, not an obfuscated payload., No eval, VM, or arbitrary remote-code loader found in inspected JS., No broad credential-file harvesting beyond its own ks credentials file., Skills document requires confirmation for user-requested remote writes.

## Affected versions and remediation

This report applies to @kespace/ks-cli-hermes@1.1.20.

- Review the evidence and your use of @kespace/ks-cli-hermes@1.1.20 before allowing it. Restrict the permissions described in this report.
- Choose an independently verified alternative or release. This report does not establish that other versions are safe.

## Public findings

### 1. High: Install Time Lifecycle Scripts
- **Category:** Manifest
- **Confidence:** 90.0%
- **Path:** package.json
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/package.json>)

Package defines install-time lifecycle scripts.

Public source snippet (untrusted):

```json
scripts.postinstall = node ./scripts/postinstall.mjs
```

### 2. Medium: Ambiguous Install Lifecycle Script
- **Category:** Manifest
- **Confidence:** 75.0%
- **Path:** package.json
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/package.json>)

Install-time lifecycle script is not statically allowlisted and needs review.

Public source snippet (untrusted):

```json
scripts.postinstall = node ./scripts/postinstall.mjs
```

### 3. Low: Non Install Lifecycle Scripts
- **Category:** Manifest
- **Confidence:** 80.0%

Package declares lifecycle scripts that are not normally run for registry tarball installs.

### 4. Low: Scripts Present
- **Category:** Manifest
- **Confidence:** 100.0%

Package declares npm scripts.

### 5. High: Child Process
- **Category:** Source
- **Confidence:** 85.0%
- **Path:** hooks/openclaw/ks-updater-hook/handler.ts
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/hooks/openclaw/ks-updater-hook/handler.ts>)

Package source references child process execution.

Public source snippet (untrusted):

```typescript
L1: import { spawn } from 'node:child_process';
L2: import { existsSync } from 'node:fs';
```

### 6. High: Shell
- **Category:** Source
- **Confidence:** 85.0%
- **Path:** scripts/install-lib.mjs
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/scripts/install-lib.mjs>)

Package source references shell execution.

Public source snippet (untrusted):

```javascript
L147: }
L148: console.log(`ks: 请重开 CMD/PowerShell 后执行 \`${agent.commandName} --version\``);
L149: return;
```

### 7. Medium: Network
- **Category:** Source
- **Confidence:** 75.0%

Package source references network APIs.

### 8. Medium: Environment Vars
- **Category:** Source
- **Confidence:** 75.0%

Package source references environment variables.

### 9. Medium: Install Persistence
- **Category:** Source
- **Confidence:** 75.0%
- **Path:** scripts/purge.mjs
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/scripts/purge.mjs>)

Source writes installer persistence such as shell profile or service configuration.

Public source snippet (untrusted):

```javascript
L2: import { join } from 'path';
L3: import { execSync } from 'child_process';
L4: import { fileURLToPath } from 'url';
...
L119: try {
L120: return JSON.parse(readFileSync(path, 'utf8'));
L121: } catch {
...
L157: function npm[redacted](pkg) {
L158: if (process.env.KS_PURGE_SKIP_NPM_UNINSTALL === '1') {
L159: console.log(`ks: npm package removed → ${pkg} (skipped in test)`);
...
L235: }
L236: removePackageDepsFromJson(join(prefix, 'package.json'), pkg);
L237: removePackageDepsFromJson(join(prefix, 'package-lock.json'), pkg);
```

### 10. Low: Filesystem
- **Category:** Source
- **Confidence:** 70.0%

Package source references filesystem APIs.

### 11. Critical: Persistence Backdoor
- **Category:** Source
- **Confidence:** 90.0%
- **Path:** scripts/platform.mjs
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/scripts/platform.mjs>)

Source writes persistence or remote-access backdoor material.

Public source snippet (untrusted):

```javascript
L12: } from 'fs';
L13: import { execFileSync, execSync } from 'child_process';
L14: import { homedir, userInfo } from 'os';
...
L23: /** @param {string} [platform] @param {string} [arch] */
L24: export function resolveBinaryName(platform = process.platform, arch = process.arch) {
L25: if (platform === 'darwin' && arch === 'arm64') return 'ks-darwin-arm64';
...
L107: stdio: ['ignore', 'pipe', 'ignore'],
L108: env: process.env,
L109: });
...
L135: try {
L136: return userInfo().homedir;
L137: } catch {
```

### 12. Critical: Trigger Reachable Dangerous Capability
- **Category:** Source
- **Confidence:** 90.0%
- **Path:** scripts/platform.mjs
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/scripts/platform.mjs>)

A package entrypoint or install-time lifecycle script reaches a source file with blocking dangerous behavior.

Public source snippet (untrusted):

```javascript
Trigger-reachable chain: scripts.postinstall -> scripts/postinstall.mjs -> scripts/install-lib.mjs -> scripts/platform.mjs
L12: } from 'fs';
L13: import { execFileSync, execSync } from 'child_process';
L14: import { homedir, userInfo } from 'os';
...
L23: /** @param {string} [platform] @param {string} [arch] */
L24: export function resolveBinaryName(platform = process.platform, arch = process.arch) {
L25: if (platform === 'darwin' && arch === 'arm64') return 'ks-darwin-arm64';
...
L107: stdio: ['ignore', 'pipe', 'ignore'],
L108: env: process.env,
L109: });
...
L135: try {
L136: return userInfo().homedir;
L137: } catch {
```

### 13. High: Runtime Package Install
- **Category:** Source
- **Confidence:** 86.0%
- **Path:** scripts/install-lib.mjs
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/scripts/install-lib.mjs>)

Package source invokes a package manager install command at runtime.

Public source snippet (untrusted):

```javascript
L520: try {
L521: execSync('npm install --omit=dev --no-fund --no-audit', {
L522: cwd: scriptsDir,
```

### 14. Low: High Entropy Strings
- **Category:** Supply Chain
- **Confidence:** 55.0%

Package source contains high-entropy string patterns.

### 15. Low: Url Strings
- **Category:** Supply Chain
- **Confidence:** 65.0%

Package source contains URL literals.

### 16. Medium: Ships Native Binary
- **Category:** Artifact Inventory
- **Confidence:** 75.0%
- **Path:** binaries/ks-darwin-amd64
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/binaries/ks-darwin-amd64>)

Package ships native binary artifacts.

Public source snippet (untrusted):

```text
path = binaries/ks-darwin-amd64
kind = native_binary
sizeBytes = 12940016
magicHex = [redacted]
```

### 17. Medium: Ships Build Helper
- **Category:** Artifact Inventory
- **Confidence:** 70.0%
- **Path:** bin/ks.cmd
- **Public source:** [View source](<https://unpkg.com/@kespace/ks-cli-hermes@1.1.20/bin/ks.cmd>)

Package ships non-JavaScript build or shell helper files.

Public source snippet (untrusted):

```text
path = bin/ks.cmd
kind = build_helper
sizeBytes = 3387
magicHex = [redacted]
```

### 18. Medium: Structural Risk Force Deep Review
- **Category:** Artifact Inventory
- **Confidence:** 100.0%

Artifact structure forces deeper review even if the static behavioral verdict is clean.

### 19. Low: No License
- **Category:** Manifest
- **Confidence:** 80.0%

Package manifest does not declare a clear license.

## Dependencies and install lifecycle
- **Lifecycle scripts present:** Yes
- **Published lifecycle scripts:** postinstall, preuninstall
- **Dependencies:** 1
- **Optional dependencies:** 0
- **Peer dependencies:** 0
- **Development dependencies:** 0
- **Published dependency-graph edges:** 1

### Published dependency entries
- yaml ^2.7.0 (Dependency)

## Package metadata
- **Package:** @kespace/ks-cli-hermes
- **Ecosystem:** npm
- **Version:** 1.1.20
- **Version published:** 2026-07-30T11:42:00.503Z
- **Package first seen:** 2026-07-30T11:46:12.008Z
- **Package last seen:** 2026-11-06T20:05:09.789Z
- **Known versions:** 4
- **Latest version:** 1.1.21
- **Appeal under review:** No
- **Description:** KnowledgeSpace CLI + SKILL installer for Hermes
- **Maintainers:** zqke
- **Runtime engines:** node: \>=16
- **Artifact files:** 38
- **Artifact unpacked size:** 100,133,285 bytes
- **Artifact signatures:** 1
- **Attestations:** No

## References
- [HTML security report](<https://firewall.lpm.dev/npm/@kespace/ks-cli-hermes/v/1.1.20>)
