registry  /  @threadbase-sh/streamer  /  1.23.1

@threadbase-sh/streamer@1.23.1

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 install-time or import-time attack surface. The package is an explicitly invoked Threadbase/Claude streaming server with local service, PTY, scanner, upload, and updater features.

Static reason
High-risk behavior combination matched malicious policy.
Trigger
User runs threadbase-streamer CLI or standalone docker seed entrypoint
Impact
Runtime can read Claude conversation files, spawn Claude sessions, write project upload files, and update ~/.threadbase when configured by the user.
Mechanism
package-aligned Claude PTY server and optional signed updater
Rationale
The risky primitives are tied to the package's stated Claude streaming/updater functionality and are activated by explicit CLI/server/docker entrypoints, while npm postinstall only adjusts a dependency helper permission. I found no unconsented lifecycle mutation of foreign AI-agent control surfaces, persistence, exfiltration, or remote code execution outside configured update behavior.
Evidence
package.jsondist/index.cjsdist/cli.cjsdist/seed-claude-config.cjsdist/launchd-entry.cjsnode-pty/prebuilds/<platform-arch>/spawn-helper~/.threadbase/server.yaml~/.threadbase/cache/cache.db~/.threadbase/releases~/.threadbase/cli.js~/.claude/projects<project>/.threadbase-uploads/<sessionId>CLAUDE_CONFIG
Network endpoints4
api.github.com127.0.0.1:<port>localhost:<port>ws://localhost:<port>/ws

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 when explicitly executed
  • dist/cli.cjs user-invoked server can spawn Claude CLI with --permission-mode acceptEdits
  • dist/cli.cjs has signed update route that can run CLI update when configured
Evidence against
  • package.json postinstall only chmods node-pty spawn-helper inside dependency prebuilds
  • No lifecycle script writes .claude, MCP, shell startup, VCS hooks, services, or agent config
  • Claude config seeding is a standalone entrypoint gated by CLAUDE_CONFIG, not npm install/import
  • Network use is package-aligned: local HTTP/WebSocket server and GitHub release updater
  • Updater verifies manifest sha256/size before swapping ~/.threadbase release files
  • No credential harvesting or exfiltration found; auth keys are local server pairing/update controls
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 = 7141089 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 = 7141089 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