FluxyChat

Reference

URL fetch audit

validateUrl and audit logging for OG preview and outbound enrichment fetches.

All link preview fetches go through validateUrl and fetchUrlWithAudit before HTTP. Blocked SSRF attempts and successful fetches are logged to url_fetch_audit.

validateUrl

import { validateUrl } from "./url-fetch-audit.js";

const result = validateUrl("https://example.com", env);
// { ok: true, url: URL } | { ok: false, reason: "ssrf_blocked" }

Also exported from url-ssrf.ts for TypeScript call sites.

Audit API

MethodPathDescription
GET/security/url-fetch-auditList audit rows (?feature=link_preview)
POST/security/url-fetch-audit/validateDry-run URL validation

Features logged

FeatureCall site
link_previewrich-previews.jsfetchOgPreview
og_previewDirect OG fetch
og_preview_browserBrowser Run fallback

Outcomes

  • blocked — SSRF / invalid URL
  • success — HTTP 2xx
  • http_error — non-2xx response
  • error — network / redirect failure

On this page