GHSA-3ww8-jw56-9f5h: FHIR Validator: Unauthenticated Blind SSRF via /loadIG Endpoint Enables Internal Network Probing
SummaryThe `/loadIG` HTTP endpoint in the FHIR Validator HTTP service accepts a user-supplied URL via JSON body and makes server-side HTTP requests to it without any hostname, scheme, or domain validation. An unauthenticated attacker with network access to the validator can probe internal network services, cloud metadata endpoints, and map network topology through error-based information leakage. With `explore=true` (the default for this code path), each request triggers multiple outbound HTTP calls, amplifying reconnaissance capability.Details**Root cause chain:**`LoadIGHTTPHandler.handle()` reads the `ig` field from user-supplied JSON and passes it directly to `IgLoader.loadIg()` with no validation:`loadIg()` calls `loadIgSource(srcPackage, recursive, true)` with `explore=true` (IgLoader.java:153).`loadIgSource()` checks `Common.isNetworkPath(src)` which only verifies the URL starts with `http:` or `https:` — no host/IP validation (Common.java:14-16).The URL reaches `ManagedWebAccess.get()` which calls `inAllowedPaths()`. This check is a no-op by default because `allowedDomains` is initialized as an empty list, and the code explicitly returns `true` when empty:The source code has a `//TODO get this from fhir settings` comment (line 82) confirming this is an incomplete security control.`SimpleHTTPClient.get()` makes the HTTP request and follows 301/302/307/308 redirects up to 5 times. Redirect targets are NOT re-validated against `inAllowedPaths()`:The server binds to all interfaces with no authentication (FhirValidatorHttpService.java:31):Errors propagate back to the attacker with exception details:**Redirect bypass:** Even if `allowedDomains` were configured, the domain check in `ManagedWebAccessor.setupSimpleHTTPClient()` (line 31) only validates the initial URL. An attacker can host a redirect on an allowed domain that points to an internal target.PoCStart the FHIR Validator in HTTP server mode:Probe a cloud metadata endpoint:Expected: The validator makes a GET request to the AWS metadata service from its own network position. The error response reveals whether the endpoint is reachable (e.g., connection refused vs. parse error on HTML content).Port scan an internal host:Redirect bypass (if allowedDomains were configured):The validator follows the redirect to the internal target without re-checking the domain allowlist.ImpactAn unauthenticated attacker with network access to the FHIR Validator HTTP service can:**Probe internal network services** — differentiate open/closed ports and reachable/unreachable hosts via error message analysis (connection refused vs. timeout vs. content parse errors)**Access cloud metadata endpoints** — reach AWS/GCP/Azure instance metadata services (169.254.169.254) from the validator's network position**Map internal network topology** — systematically enumerate internal hosts and services**Bypass domain restrictions via redirects** — even if allowedDomains is configured, redirect following does not re-validate targets**Amplify reconnaissance** — each `/loadIG` call with `explore=true` generates multiple outbound requests (package.tgz, JSON, XML variants)This is a blind SSRF — the fetched content is not directly returned. Impact is limited to network probing and error-based information leakage rather than full content exfiltration.Recommended Fix**Add URL validation** in `LoadIGHTTPHandler` before passing to `loadIg()` — reject private/internal IP ranges and non-standard ports:**Re-validate redirect targets** in `SimpleHTTPClient.get()` — check `inAllowedPaths()` for each redirect URL:**Configure `allowedDomains` by default** to restrict outbound requests to known FHIR registries (e.g., `packages.fhir.org`, `hl7.org`), or require explicit opt-in for open access.**Add authentication** to the HTTP service, at minimum for state-changing endpoints like `/loadIG`.
CVSS v3.1: 5.8