Skip to content

In-depth lesson · Blind SSRF

Typical fixes

Every point the Blind SSRF reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 12 of 12
  1. Parse the URL and compare the actual host against the allow-list rather than searching for a substring.

    Seen in 2 reports
  2. Apply the existing localhost validation function to every import URL.

    Seen in 2 reports
  3. Do not build outbound URLs from the Host header; validate the host before any request.

    Seen in 1 report
  4. Use the SSRF-protected HTTP helper instead of the raw HTTP library.

    Seen in 1 report
  5. Set a redirect policy on the Docker client so it does not follow redirects from the daemon.

    Seen in 1 report
  6. Re-check the destination against the blocklist after every redirect.

    Seen in 1 report
  7. Re-check the resolved address after DNS resolution to defeat rebinding.

    Seen in 1 report
  8. Apply the same SSRF protection to the detect host keys function as to the main mirroring feature.

    Seen in 1 report
  9. Strip carriage return and line feed characters from webhook header names.

    Seen in 1 report
  10. Do not allow local requests in analytics fetches and trim error responses before logging.

    Seen in 1 report
  11. Do not let an image library auto-detect user input as a URL or path; validate the content type.

    Seen in 1 report
  12. Validate and restrict the destination of user-supplied URLs before fetching.

    Seen in 1 report