Documentation
¶
Overview ¶
Package ssrf provides Server-Side Request Forgery guards for URL-fetching tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResolvedAddrs ¶
CheckResolvedAddrs rejects a hostname when any resolved address is blocked.
func CheckURLHost ¶
CheckURLHost validates a URL host literal IP (no DNS). Hostnames that are not literal IPs pass this check; callers that resolve DNS should also call CheckResolvedAddrs.
func IsBlockedIP ¶
IsBlockedIP reports whether ip is in a private, link-local, CGNAT, or unspecified range that must not be fetched. Loopback is allowed for local development (matching grok-build web_fetch policy).
func LookupAndCheck ¶
LookupAndCheck resolves host and rejects blocked addresses.
Types ¶
type ErrBlocked ¶
ErrBlocked is returned when a host or resolved address is in a blocked range.
func (ErrBlocked) Error ¶
func (e ErrBlocked) Error() string