registry  /  @alfe.ai/gateway  /  0.2.3

@alfe.ai/gateway@0.2.3

Alfe local gateway daemon — persistent control plane for agent integrations

AI Security Review

scanned 3d ago · by lpm-firewall-ai

No confirmed malicious attack surface was found. The package is a user-started authenticated gateway daemon with powerful but package-aligned remote management features.

Static reason
High-risk behavior combination matched malicious policy.; previous stored version diff introduced dangerous source
Trigger
User runs alfe-gateway daemon/start/install or imports and calls exported daemon/service functions.
Impact
Can manage local Alfe/OpenClaw/Hermes runtime state after explicit daemon use; no install-time or import-time compromise found.
Mechanism
Authenticated local gateway daemon, cloud WebSocket commands, runtime/service management.
Rationale
Static source inspection shows dangerous primitives only inside a user-invoked authenticated gateway/control-plane daemon, with no lifecycle hook, import-time execution, hidden payload decode/execute path, credential harvesting, or unrelated exfiltration. The scanner's critical remote-asset/eval finding appears noisy: the relevant eval/base64 references are bundled libraries, while package code fetches Alfe workspace/template data and processes authenticated cloud commands for its stated purpose.
Evidence
package.jsondist/bin/gateway.jsdist/src/index.jsdist/health.jsdist/runtime-upgrade.jsdist/upgrade.jsdist/logger.js~/.alfe/logs/gateway.log~/.alfe/gateway.pid~/.alfe/gateway.sock~/Library/LaunchAgents/ai.alfe.gateway.plist~/.config/systemd/user/alfe-gateway.service/etc/systemd/system/alfe-gateway.service~/.alfe/.openclaw-mirror-migrated
Network endpoints2
wss://gateway.alfe.ai/ws127.0.0.1:18193

Decision evidence

public snapshot
AI called this Clean at 82.0% confidence as Benign with medium false-positive risk.
Evidence for block
  • dist/health.js starts a WebSocket control client using bearer auth to config.gatewayWsUrl and handles cloud COMMAND messages.
  • dist/health.js supports daemon.update/runtime.update commands that run npm/hermes/openclaw upgrade commands after daemon start.
  • dist/health.js can apply runtime config via alfe.config_set and dynamically import registered integration handlers.
  • dist/health.js installs optional launchd/systemd service files only through explicit CLI install command.
Evidence against
  • package.json has no install/preinstall/postinstall lifecycle hooks.
  • dist/bin/gateway.js only dispatches user-invoked CLI commands; default import does not start the daemon.
  • Scanner eval/base64 hits are bundled dependency/runtime feature code, not remote asset decode-and-execute logic in package code.
  • Network use is aligned with an authenticated Alfe gateway daemon and local AI proxy, not credential harvesting or arbitrary exfiltration.
  • File writes are expected daemon state/service/log/socket files under ~/.alfe, runtime homes, or service-manager paths.
Behavioral surface
Source
ChildProcessCryptoDynamicRequireEnvironmentVarsEvalFilesystemNetworkShellWebSocket
Supply chain
HighEntropyStringsUrlStrings
Manifest
NoLicense
scanned 6 file(s), 718 KB of source, external domains: 127.0.0.1, adaptivecards.io, aws.amazon.com, dotenvx.com, github.com, json-schema.org, www.apple.com, www.google.com, your-log-dashboard-url.com

Source & flagged code

7 flagged · loading source
dist/health.jsView file
3import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises"; L4: import { execFile, execSync, spawn } from "node:child_process"; L5: import { promisify } from "node:util"; ... L12: import { parse } from "smol-toml"; L13: import WebSocket from "ws"; L14: import { createConnection, createServer } from "node:net"; ... L327: } L328: const body = await res.json(); L329: if (!res.ok) return { ... L360: ok: true, L361: data: result.body.data L362: };
Critical
Remote Asset Decode Execute

Source fetches a remote non-code asset, decodes its contents, and dynamically executes the decoded payload.

dist/health.jsView on unpkg · L3
Trigger-reachable chain: manifest.main -> dist/src/index.js -> dist/health.js Reachable file contains a blocking source-risk pattern.
Critical
Trigger Reachable Dangerous Capability

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

dist/health.jsView on unpkg
matchType = previous_version_dangerous_delta matchedPackage = @alfe.ai/gateway@0.2.2 matchedIdentity = npm:QGFsZmUuYWkvZ2F0ZXdheQ:0.2.2 similarity = 0.833 summary = stored previous version shares package body but lacks this dangerous source file
Critical
Previous Version Dangerous Delta

This package version adds a dangerous source file absent from the previous stored version; route for source-aware review.

dist/health.jsView on unpkg
3import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises"; L4: import { execFile, execSync, spawn } from "node:child_process"; L5: import { promisify } from "node:util";
High
Child Process

Package source references child process execution.

dist/health.jsView on unpkg · L3
870try { L871: new Function(""); L872: return true;
High
Eval

Package source references dynamic code evaluation.

dist/health.jsView on unpkg · L870
58}) : target, mod)); L59: var __require = /* @__PURE__ */ createRequire(import.meta.url); L60: //#endregion
Medium
Dynamic Require

Package source references dynamic require/import behavior.

dist/health.jsView on unpkg · L58
3import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises"; L4: import { execFile, execSync, spawn } from "node:child_process"; L5: import { promisify } from "node:util"; ... L12: import { parse } from "smol-toml"; L13: import WebSocket from "ws"; L14: import { createConnection, createServer } from "node:net"; ... L327: } L328: const body = await res.json(); L329: if (!res.ok) return { ... L360: ok: true, L361: data: result.body.data L362: };
Medium
Install Persistence

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

dist/health.jsView on unpkg · L3

Findings

3 Critical3 High5 Medium5 Low
CriticalRemote Asset Decode Executedist/health.js
CriticalTrigger Reachable Dangerous Capabilitydist/health.js
CriticalPrevious Version Dangerous Deltadist/health.js
HighChild Processdist/health.js
HighShell
HighEvaldist/health.js
MediumDynamic Requiredist/health.js
MediumNetwork
MediumEnvironment Vars
MediumInstall Persistencedist/health.js
MediumStructural Risk Force Deep Review
LowScripts Present
LowFilesystem
LowHigh Entropy Strings
LowUrl Strings
LowNo License