registry  /  @threadbase-sh/streamer  /  1.21.0

@threadbase-sh/streamer@1.21.0

PTY session management, WebSocket streaming, and REST API server for Claude Code conversations

AI Security Review

scanned 12d ago · by lpm-firewall-ai

No confirmed malicious attack surface was established. The high-risk primitives are part of a Claude Code PTY streamer and local updater, activated by explicit CLI/server use rather than install-time compromise.

Static reason
High-risk behavior combination matched malicious policy.
Trigger
npm install postinstall chmod; user runs threadbase-streamer/tb-streamer serve, update, or Docker seed script
Impact
User-invoked management of local Claude sessions and ~/.threadbase state; no confirmed stealth persistence, exfiltration, or unconsented install-time AI control mutation.
Mechanism
local PTY/session server with authenticated API, optional signed updater, and explicit Claude config seeding utility
Rationale
Static inspection shows dangerous primitives, but they are package-aligned and gated by explicit runtime commands, authentication, signatures, or local configuration. The install hook is limited to chmod on node-pty's spawn-helper and does not fetch, execute remote payloads, harvest credentials, or mutate AI-agent controls.
Evidence
package.jsondist/index.cjsdist/cli.cjsdist/seed-claude-config.cjsdist/launchd-entry.cjsREADME.md~/.threadbase/server.yaml~/.threadbase/current~/.threadbase/cli.jsCLAUDE_CONFIG
Network endpoints2
localhost:8766ws://localhost:8766/ws

Decision evidence

public snapshot
AI called this Clean at 86.0% confidence as Benign with medium false-positive risk.
Evidence for block
  • dist/seed-claude-config.cjs writes a Claude config path from CLAUDE_CONFIG when run directly, approving onboarding/trust flags for /data/.claude/projects.
  • dist/index.cjs spawns the local claude CLI in a PTY with --permission-mode acceptEdits during user-requested sessions.
  • dist/cli.cjs includes an updater that downloads release assets and swaps ~/.threadbase/current when update commands or signed update webhook are used.
Evidence against
  • package.json postinstall only chmods node-pty prebuild spawn-helper and ignores failures; no package code execution beyond that helper permission fix.
  • dist/index.cjs /api/__update requires configured webhook_secret and HMAC signature before spawning cli update --force.
  • dist/cli.cjs updater verifies manifest sha256 and size before unpacking downloaded artifacts.
  • README.md and CLI behavior align with PTY session management, WebSocket server, pairing, and local Claude Code control.
  • No credential harvesting or exfiltration endpoint found; API key writes are local ~/.threadbase/server.yaml or sealed pairing responses.
Behavioral surface
Source
ChildProcessCryptoEnvironmentVarsFilesystemNetworkShell
Supply chain
HighEntropyStringsUrlStrings
ManifestNo manifest risk signals triggered.
scanned 4 file(s), 1.34 MB of source, external domains: github.com, json-schema.org
Oversized source lightweight scan
dist/cli.cjs6.81 MB file, sampled 256 KB
FilesystemNetworkChildProcessEnvironmentVarsCryptoHighEntropyStrings

Source & flagged code

7 flagged · loading source
package.jsonView file
scripts.postinstall = node -e "try{require('fs').chmodSync(require('path').join(require.resolve('node-pty'),'..','..','prebuilds',process.platform+'-'+process.arch,'spawn-helper'),0o755)}catch{}"
Critical
Red Install Lifecycle Script

Install-time lifecycle script matches a deterministic static-gate block pattern.

package.jsonView on unpkg
scripts.postinstall = node -e "try{require('fs').chmodSync(require('path').join(require.resolve('node-pty'),'..','..','prebuilds',process.platform+'-'+process.arch,'spawn-helper'),0o755)}catch{}"
High
Install Time Lifecycle Scripts

Package defines install-time lifecycle scripts.

package.jsonView on unpkg
dist/index.jsView file
478// src/process-discovery.ts L479: import { execFile } from "child_process"; L480: import { platform as platform2 } from "os";
High
Child Process

Package source references child process execution.

dist/index.jsView on unpkg · L478
55} L56: function readAgentConfig(env = process.env) { L57: const enabled = isTruthy(env.MULTI_AGENT_FLOW); ... L160: try { L161: return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected)); L162: } catch { ... L179: const app = new Hono(); L180: app.post("/sessions/:sessionId/progress", async (c) => { L181: if (!deps.agentConfig.enabled) { ... L280: import { join as join2 } from "path"; L281: var CONFIG_DIR = join2(homedir(), ".threadbase"); L282: var CONFIG_FILE = join2(CONFIG_DIR, "server.yaml");
Low
Weak Crypto

Package source references weak cryptographic algorithms.

dist/index.jsView on unpkg · L55
dist/index.cjsView file
101Cross-file remote execution chain: dist/index.cjs spawns dist/index.js; helper contains network access plus dynamic code execution. L101: } L102: function readAgentConfig(env = process.env) { L103: const enabled = isTruthy(env.MULTI_AGENT_FLOW); ... L206: try { L207: return import_node_crypto.default.timingSafeEqual(Buffer.from(signature), Buffer.from(expected)); L208: } catch { ... L225: const app = new import_hono.Hono(); L226: app.post("/sessions/:sessionId/progress", async (c) => { L227: if (!deps.agentConfig.enabled) { ... L326: var import_path = require("path"); L327: var CONFIG_DIR = (0, import_path.join)((0, import_os.homedir)(), ".threadbase"); L328: var CONFIG_FILE = (0, import_path.join)(CONFIG_DIR, "server.yaml");
High
Cross File Remote Execution Context

Source spawns a local helper that also contains network and dynamic execution context; review data flow before blocking.

dist/index.cjsView on unpkg · L101
dist/cli.cjsView file
path = dist/cli.cjs kind = oversized_source_file sizeBytes = 7138820 magicHex = [redacted]
High
Oversized Source File

Package contains source files above the static scanner size ceiling.

dist/cli.cjsView on unpkg
path = dist/cli.cjs kind = oversized_cli_entrypoint sizeBytes = 7138820 magicHex = [redacted]
Medium
Oversized Cli Entrypoint

Package contains an oversized executable-looking CLI entrypoint.

dist/cli.cjsView on unpkg

Findings

1 Critical5 High4 Medium6 Low
CriticalRed Install Lifecycle Scriptpackage.json
HighInstall Time Lifecycle Scriptspackage.json
HighChild Processdist/index.js
HighShell
HighCross File Remote Execution Contextdist/index.cjs
HighOversized Source Filedist/cli.cjs
MediumNetwork
MediumEnvironment Vars
MediumOversized Cli Entrypointdist/cli.cjs
MediumStructural Risk Force Deep Review
LowNon Install Lifecycle Scripts
LowScripts Present
LowWeak Cryptodist/index.js
LowFilesystem
LowHigh Entropy Strings
LowUrl Strings