Resources · 72

URL imports: prevent unauthorized server requests

Prevent SSRF in downloads, previews and connectors accessing user-supplied addresses.

· 2 min

Server racks in a data centre Illustration · fictional scene

What this guide helps achieve

  • Inventory outbound access
  • Restrict destinations
  • Limit network access
  • Test denials

Quick check

  • Which destinations can the component reach?
  • Is each redirect checked before connection?
  • Are denials tested with mock targets?

Step-by-step method

  1. 01

    Inventory outbound access

    List image imports, document retrieval, link previews and connectors. Record protocols, libraries, legitimate destinations and networks reachable from each component. The public interface does not describe server access.

    Deliverable: outbound-access map.

  2. 02

    Restrict destinations

    For known services, use a strict allowlist. Validate schemes, names, ports and resolved addresses with suitable tools. Check each redirect or disable redirects. A regular expression on URL text is insufficient.

    Deliverable: destination policy.

  3. 03

    Limit network access

    Add egress restrictions and isolation for the retrieval component. Limit time, size and redirects. Check internal and metadata-service protections without placing secrets in tests.

    Deliverable: outbound rules and limits.

  4. 04

    Test denials

    In an authorized lab, use mock destinations representing private networks, loopback, redirects and changed resolution. Check rejection before connection and ensure errors disclose no sensitive information. Retain results when connectors change.

    Deliverable: negative tests and denial evidence.

Reusable worksheet

Complete with your authorised observations. These fields are a working template, not observed results.

FieldInformation to record
FeatureURL input, component and legitimate destinations
PolicySchemes, hosts, ports, resolution and redirects
TestMock destination, expected and observed denial

Worked example

Illustrative situation

Fictional example: a preview tool accepts a public test URL redirecting to a mock private service.

Decision and expected evidence

Policy rejects the new destination. The team checks the denial log, transfer limits and absence of returned private content.

Distinguish the mechanisms

MechanismPurposeCheck or limitation
Known destinationsRestrict to explicitly permitted servicesCheck resolution and redirects
Open external URLsSupport a broader featureRequires additional isolation and controls

Management indicators

IndicatorWhat it measuresFirst action
Documented outbound accessFeatures linked to policiesResolve connectors without owners
Verified denialsForbidden cases blocked before connectionFix uncontrolled paths

Common pitfalls

  • Validate only the name displayed in the URL
  • Allow the component to reach all internal networks

Frequently asked questions

Is HTTPS enough?

No. The protocol does not establish authorization or a stable destination after resolution or redirection.

Can validation exist only in the browser?

No. The requesting service must enforce its policy, complemented by network controls.

Can tests target third-party systems?

Use controlled environments and explicit authorization. The method requires no intrusive third-party testing.

Official references

References consulted: . The method and worksheet propose checks to adapt to your context; they do not constitute certification.