defensive-ssrf

Validate and pin resolved IPs to block SSRF in server-side HTTP requests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/RideMatch1/a.e.g.i.s --skill defensive-ssrf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defensive-ssrf
Source: https://github.com/RideMatch1/a.e.g.i.s/tree/main/packages/skills/skills/defensive/aegis-native/ssrf-defense
Command: npx skills add https://github.com/RideMatch1/a.e.g.i.s --skill defensive-ssrf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Server-side fetches that rely on user input can be manipulated to reach internal networks or cloud metadata endpoints. This Skill provides a structured SSRF defense pattern that validates the destination IP before making outbound requests and pins the resolution to defeat DNS rebinding.

Core Features & Use Cases

  • SSRF-safe fetch primitive (safeFetch) that validates hostname/IP and pins resolution for the actual fetch.
  • Protocol and IP-range enforcement (http/https only; block private, loopback, link-local, metadata endpoints, and cloud metadata).
  • Guidance for hardening server endpoints like image proxies, webhooks, and OAuth callbacks, and remediation patterns for ssrf-checker findings.

Quick Start

Use the SSRF defense pattern by wrapping outbound fetch calls with safeFetch and enabling strict IP/host validation.

Frequently Asked Questions about defensive-ssrf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SSRF attacks when my server fetches user-provided URLs?

Prevent SSRF attacks by validating the resolved IP address before making outbound fetches and pinning the DNS resolution to defeat DNS rebinding. This ensures user-provided URLs cannot reach internal networks or cloud metadata endpoints.

What is DNS rebinding and how does safeFetch protect against it?

DNS rebinding changes a hostname's IP resolution between validation and the actual fetch. safeFetch protects against it by pinning the resolved IP address during the outbound request, ensuring the destination cannot change after validation passes.

How do I block cloud metadata endpoints in an image proxy or webhook receiver?

Block cloud metadata endpoints in an image proxy or webhook receiver by enforcing IP range restrictions that reject RFC1918, loopback, link-local, and known cloud metadata addresses before initiating the outbound fetch request.

Does this SSRF defense pattern support OAuth callbacks and link previews?

Yes, this SSRF defense pattern supports OAuth callbacks and link previews. It applies to any flow where user input influences outgoing requests, wrapping them with safeFetch to enforce protocol and IP range validation.

What is the best way to remediate ssrf-checker findings for server-side fetches?

Remediate ssrf-checker findings by wrapping outbound fetch calls with safeFetch. This applies strict protocol filtering for http/https only and blocks private, loopback, link-local, and metadata IP ranges before execution.

When should I not use a standard fetch for server-side requests?

Do not use a standard fetch for server-side requests when the destination URL is derived from user input. Without IP validation and DNS pinning, standard fetches are vulnerable to SSRF and DNS rebinding attacks targeting internal networks.