isLoopbackHost (shared/probe-host-allowlist.ts)

agent-network · server/src/shared/probe-host-allowlist.ts · typescript · Apache-2.0
ai

SSRF protection module with vendor host allowlist, private IP blocking, and URL validation for probe requests.

// Source: https://github.com/sleep2agi/agent-network | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// RFC-028 P1 §4.4 — shared probe SSRF guards.
// Host allowlist + private IP block + validateBaseUrl.
//
// MUST be byte-identical between hub (server/src/shared/) and daemon
// (agent-node/src/shared/). Enforced by probe-host-allowlist-drift.test.ts
// (same pattern as reserved-env.ts G9 drift guard, RFC-026 §4.4.7).
//
// Why mirror not symlink: hub and daemon are separate npm packages
// installed independently on different machines. A drift-checked source
// copy survives `npm pack` + global install; a symlink does not.
//
// Threat model the daemon re-check defends against:


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key