diegosouzapw/OmniRoute · error · OutboundUrlGuardError
OUTBOUND_URL_GUARD_BLOCKED
OUTBOUND_URL_GUARD_BLOCKED
Error message
Blocked cloud-metadata catalog URL (SSRF protection)
What it means
Error "Blocked cloud-metadata catalog URL (SSRF protection)" thrown in diegosouzapw/OmniRoute.
Source
Thrown at src/lib/cli-helper/config-generator/opencode.ts:25
} from "../../../shared/network/outboundUrlGuard";
import { resolveOpencodeConfigPath } from "../../../shared/services/opencodeConfigPath";
const JSON_FORMATTING_OPTIONS = { insertSpaces: true, tabSize: 2 } as const;
/**
* SSRF guard for the catalog fetch (CodeQL js/request-forgery #326). The catalog
* source is the user's OWN OmniRoute instance, so loopback/private hosts are the
* legitimate default and must stay allowed — we cannot use the public-only guard
* here. What has NO legitimate use as a catalog source is the cloud-metadata /
* link-local pivot (169.254.169.254, metadata.google.internal, …): that is the
* classic SSRF→IAM-credential escalation and is blocked unconditionally, along
* with non-http(s) protocols and embedded credentials (via parseOutboundUrl).
*/
export function assertSafeCatalogUrl(rawUrl: string): URL {
const url = parseOutboundUrl(rawUrl); // throws on bad protocol / embedded creds
if (isCloudMetadataHost(url.hostname)) {
throw new OutboundUrlGuardError("Blocked cloud-metadata catalog URL (SSRF protection)", {
code: "OUTBOUND_URL_GUARD_BLOCKED",
url: url.toString(),
hostname: url.hostname,
});
}
// Return the re-parsed URL so callers fetch the validated value (a `new URL()`
// round-trip is a recognized request-forgery barrier — clears CodeQL #326).
return url;
}
/**
* OpenAI-compatible model entry — subset of fields the /v1/models endpoint
* returns. Only the fields we need to emit `limit.context` / `limit.output`
* are typed.
*/
interface CatalogModelEntry {
id: string;
owned_by?: string;
/** OpenAI-compatible field name; some upstreams return this. */View on GitHub (pinned to a179ffed5b)
When it happens
Trigger: Thrown at src/lib/cli-helper/config-generator/opencode.ts:25 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/7284f2e5838a4ff9.
Report an issue: GitHub.