Summary
Wanderer's trail download endpoint can fetch a URL supplied by an unauthenticated requester and return the response. When the instance is not configured as private, this may let an attacker reach internal services or other network destinations, exposing data or disrupting services.
Affected context
The issue affects Wanderer deployments before 0.20.0 when PUBLIC_PRIVATE_INSTANCE is not set to true. In this configuration, the unauthenticated POST /api/v1/trail/download handler passes the JSON url field to event.fetch() and returns the fetched response. The endpoint may therefore reach destinations available from the application's network environment, including internal services and cloud metadata endpoints.
Exploit preconditions
- Attack surface: The trail download HTTP endpoint
- Required access: No authentication is required
- Trigger point: A request to
POST /api/v1/trail/download - Configuration condition:
PUBLIC_PRIVATE_INSTANCEis not set totrue - Why exploitation is possible: The handler uses the user-supplied URL for a server-side fetch and returns the response without adequately restricting destinations.
Why this happens
The handler allows untrusted input to determine the destination of a server-side network request. This is a server-side request forgery flaw mapped to CWE-918: the application fetches attacker-controlled URLs from a network context that may have access to internal services or sensitive destinations.
Potential impact
- Internal service responses may be exposed to unauthenticated requesters.
- Attackers could use the application to map reachable internal network destinations.
- Requests to sensitive or resource-intensive destinations could contribute to denial of service.
- Cloud metadata or other protected endpoint data could be exposed if reachable and insufficiently protected.
General mitigation guidance
Mitigation generally focuses on preventing untrusted input from controlling outbound requests.
- Prefer fixed, application-controlled destinations or secure-by-default allowlists of permitted hosts and protocols.
- Validate and normalize URLs, and re-check resolved addresses to guard against redirects and DNS changes.
- Block requests to loopback, private, link-local, and other sensitive network ranges using network-level egress controls.
- Avoid returning fetched response bodies or details unless they are necessary and safe to disclose.
- Run the application with least-privilege network access and restrict access to internal services and metadata endpoints.
How teams detect issues like this
- Use static analysis to identify request handlers that pass user-controlled URLs to HTTP clients or fetch APIs.
- Review code for missing destination allowlists, redirect handling, DNS revalidation, and response filtering.
- Monitor outbound requests for unexpected destinations, especially private, loopback, link-local, and metadata ranges.
- Enforce egress policies that limit application traffic to required services, and review alerts for unusual outbound patterns.

