Treat user-supplied destinations as untrusted

Server-side request forgery (SSRF) happens when an application makes a server request based on attacker-controlled input. The request can reach systems that the public user cannot contact directly.

Features such as image import, webhook testing and URL previews need careful destination controls. A hostname check alone may fail if DNS resolution changes or redirects lead elsewhere.

Allow only the destinations the feature needs

Use an allowlist when the business function supports known hosts. Resolve and validate addresses at connection time. Block loopback, link-local and private network ranges unless the feature has an approved need.

Disable redirects or validate every redirect destination. Set connection and response limits so an external service cannot consume unlimited resources.

Add network controls and tests

Run the application with limited network access. Do not expose cloud credentials or internal metadata services to a general web process.

Test URL parsing, alternate address formats, redirects and DNS changes in an authorised environment. Review the server’s outbound rules as well as application code.