Summary
Two OHIF data sources, DICOMWebProxy and DICOMJSON, can be abused to fetch arbitrary attacker-controlled URLs without validation.
Because the global authentication service automatically attaches the user's OIDC Bearer token to these outbound requests, an attacker-controlled endpoint can receive and potentially misuse the token when these sources are enabled and reachable.
Affected context
This vulnerability occurs in OHIF deployments that ship with or enable the DICOMWebProxy and DICOMJSON data sources using their default configuration.
The issue manifests when these sources accept arbitrary URL parameters and the application's global authentication service injects OIDC Bearer tokens into all outgoing requests, including those derived from user-provided URLs.
DICOMweb data sources configured with standard endpoints are not impacted, but any environment that allows unvalidated remote URLs for these specific sources may expose tokens to external servers.
Exploit preconditions
- Attack surface: HTTP interface exposing the DICOMWebProxy or DICOMJSON data source configuration or query endpoints.
- Required access: Ability to supply or influence the URL parameter used by these data sources, often via application UI, configuration, or crafted requests.
- Trigger point: A request initiated by OHIF through DICOMWebProxy or DICOMJSON that resolves an arbitrary URL value.
- Why exploitation is possible: The application performs outbound HTTP requests to attacker-controlled URLs without validation or restriction while automatically attaching the authenticated user's OIDC Bearer token.
Why this happens
The underlying issue aligns with CWE-918 (Server-Side Request Forgery), where the server performs HTTP requests to user-controlled destinations.
In this case, the DICOMWebProxy and DICOMJSON sources trust a URL parameter from the client without enforcing a whitelist or validation, allowing external endpoints to be targeted.
The global authentication mechanism then blindly injects the user's OIDC Bearer token into all outbound requests from these sources, turning a generic SSRF into a credential exfiltration channel.
Abstractly, this reflects an insecure pattern where backend request configuration is derived from untrusted input and combined with privileged authentication context.
Potential impact
- Attacker-controlled servers may receive and log users' OIDC Bearer tokens.
- Attackers could potentially reuse stolen tokens to impersonate users or access protected APIs.
- Exposure of sensitive session or identity information tied to the compromised tokens.
- Increased risk of lateral movement if the token grants access to other application or infrastructure resources.
- Potential privacy and compliance violations due to unauthorized disclosure of authentication credentials.
General mitigation guidance
Mitigation generally focuses on reducing trust in user-controlled URLs and decoupling authentication headers from untrusted outbound requests.
Common defensive patterns include:
- Restricting data source URL parameters to a validated set of internal or trusted endpoints, rather than arbitrary addresses.
- Implementing strict input validation and normalization on any configuration that influences backend HTTP destinations.
- Segregating authentication mechanisms so that bearer tokens are only attached to known-safe services, not dynamically determined URLs.
- Applying least-privilege principles to tokens, limiting the scope and lifetime of OIDC Bearer tokens, and considering token binding where possible.
- Designing data source components with secure-by-default settings that disable or constrain external URL fetching unless explicitly configured and reviewed.
How teams detect issues like this
Potential detection strategies focus on identifying SSRF-style patterns and unexpected credential propagation:
- Static analysis checks or linters that flag use of unvalidated URL parameters in backend HTTP client calls, especially when authentication headers are added automatically.
- Code review practices that examine data source components and proxy logic for dynamic URL construction and assess whether these paths correctly enforce whitelists or domain restrictions.
- Logging and monitoring of outbound requests from OHIF services, including destination hostnames and presence of OIDC Bearer tokens, to spot anomalous traffic to unknown domains.
- Security policy enforcement in CI/CD pipelines that require explicit justification for external endpoints and prohibit generic "fetch arbitrary URL" features in authenticated contexts.
- Optional use of automated application security testing tools to simulate SSRF scenarios and detect cases where credentials are leaked to external systems.

