registry  /  @threadbase-sh/streamer  /  1.23.0

@threadbase-sh/streamer@1.23.0

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

AI Security Review

scanned 8d ago · by lpm-firewall-ai

No confirmed malicious attack surface was found. Risky primitives are aligned with an advertised Claude Code PTY/WebSocket streamer and are activated by server or CLI use rather than npm install.

Static reason
High-risk behavior combination matched malicious policy.
Trigger
npm install runs postinstall chmod; runtime behavior requires threadbase-streamer CLI/server commands.
Impact
Runs and manages Claude sessions and local Threadbase state when invoked; no unconsented lifecycle mutation or exfiltration found.
Mechanism
package-aligned PTY server, local config/cache writes, and user-invoked service/update management
Rationale
Static inspection shows install-time behavior is limited to chmod on a node-pty helper, while Claude spawning, config seeding, service control, and updates are package-purpose runtime or explicit CLI paths. No credential harvesting, exfiltration, remote code execution at install/import time, or unconsented foreign AI-agent control-surface mutation was identified.
Evidence
package.jsonREADME.mddist/index.cjsdist/cli.cjsdist/seed-claude-config.cjsnode-pty/prebuilds/<platform-arch>/spawn-helper~/.threadbase/server.yaml~/.threadbase/cache/cache.db~/.threadbase/releases~/.threadbase/current~/.threadbase/cli.js$CLAUDE_CONFIG
Network endpoints3
api.github.com127.0.0.1localhost

Decision evidence

public snapshot
AI called this Clean at 90.0% confidence as Benign with low false-positive risk.
Evidence for block
  • dist/seed-claude-config.cjs can write a Claude config path from CLAUDE_CONFIG, but it is a standalone Docker entrypoint helper, not an npm lifecycle hook.
  • dist/cli.cjs contains user-invoked prod/update commands that manage launchd/Task Scheduler services and self-update from GitHub releases.
Evidence against
  • package.json postinstall only chmods node-pty prebuilds/.../spawn-helper; no broad home/project agent files are written at install time.
  • package.json bin points to dist/cli.cjs; service/update/cache mutations are behind explicit CLI commands, not import/install execution.
  • dist/index.cjs spawns claude via node-pty for the advertised PTY streaming server and uses --permission-mode acceptEdits, not dangerously-skip-permissions.
  • dist/index.cjs writes only package-owned ~/.threadbase/server.yaml/cache files during normal config/server use.
  • dist/cli.cjs update path fetches GitHub releases and verifies manifest sha256/size before unpacking into ~/.threadbase/releases.
  • README.md documents npm install, set-key, serve, Homebrew service, cache, and update behavior consistent with the code.
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
483// src/process-discovery.ts L484: import { execFile } from "child_process"; L485: import { platform as platform2 } from "os";
High
Child Process

Package source references child process execution.

dist/index.jsView on unpkg · L483
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) { ... L281: function configDir() { L282: return process.env.THREADBASE_CONFIG_DIR ?? join2(homedir(), ".threadbase"); L283: }
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) { ... L327: function configDir() { L328: return process.env.THREADBASE_CONFIG_DIR ?? (0, import_path.join)((0, import_os.homedir)(), ".threadbase"); L329: }
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 = 7139736 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 = 7139736 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