Summary
A server-side request forgery (SSRF) vulnerability in the Open edX Enterprise Service app allows an authenticated Enterprise Admin to make arbitrary HTTP requests from the server by controlling the SAML metadata URL.
By setting a crafted metadata_source value and triggering sync_provider_data, an attacker can cause the application to issue requests to internal services or external endpoints without scheme or IP restrictions.
Affected context
This vulnerability affects Open edX deployments using the Enterprise Service app versions 7.0.2 to 7.0.4 where:
- The Enterprise Admin role is available to users, and
- SAML providers are managed through the SAMLProviderConfig and SAMLProviderDataViewSet APIs, and
- The application server can initiate outbound HTTP(S) connections to internal or external addresses.
The issue manifests when metadata_source values are accepted from authenticated admins and used directly as URLs in outbound requests without validation or network-level restrictions.
Exploit preconditions
- Attack surface: Application API endpoint
sync_provider_datainSAMLProviderDataViewSet. - Required access: Authenticated Enterprise Admin with permission to:
- PATCH
SAMLProviderConfig.metadata_source, and - Invoke the sync_provider_data endpoint.
- Trigger point: The call to
sync_provider_data, which leads tofetch_metadata_xml()callingrequests.get()on the attacker-controlled URL. - Why exploitation is possible:
- The metadata_source field is treated as a trusted URL.
- The value is passed directly to
requests.get()without: - Scheme enforcement (e.g., restricting to https),
- IP/hostname allowlisting or denylisting (e.g., blocking RFC1918/internal ranges),
- Connection timeout configuration.
- As a result, the server becomes an HTTP client under partial attacker control.
Why this happens
The root cause is unvalidated use of user-controlled input as a network request target, mapping directly to CWE-918: Server-Side Request Forgery (SSRF).
The Enterprise Service accepts a URL in SAMLProviderConfig.metadata_source from an authenticated admin and passes it directly into requests.get() inside fetch_metadata_xml() when sync_provider_data is invoked.
Because there is no scheme restriction, host/IP filtering, or enforcement of safe destinations, the server will attempt to connect to any endpoint an attacker specifies.
Conceptually, this is an insecure outbound interaction pattern, where application-layer authorization on who can change the URL is incorrectly assumed to be sufficient to trust the target of the outbound request.
Potential impact
- The server may issue HTTP(S) requests to internal services (e.g., metadata services, admin panels, databases with HTTP APIs), potentially exposing information via response contents or timing.
- The attacker could attempt to reach cloud metadata endpoints and similar sensitive internal URLs, which may expose credentials or configuration data if not otherwise protected.
- Internal service probing and partial network mapping may be possible based on error messages or response handling.
- Long-running or repeated requests to slow or non-responsive endpoints could tie up server resources, potentially contributing to denial-of-service conditions.
- If internal HTTP endpoints expose additional vulnerabilities, SSRF could be used as a stepping stone for further compromise.
General mitigation guidance
Effective mitigation centers on strict control of outbound request targets and hardening configuration-driven network calls:
- Introduce destination validation for metadata_source:
- Restrict to approved schemes (e.g., https only).
- Enforce host/IP allowlists for known, trusted identity provider metadata endpoints.
- Explicitly block private, loopback, link-local, and link-local multicast address ranges.
- Use network-layer controls where possible:
- Egress filtering at the firewall or proxy layer so that application instances can only reach authorized destinations.
- Segregate application servers from sensitive internal services that should not be reachable via HTTP.
- Apply defensive HTTP client configuration:
- Set conservative timeouts and connection limits.
- Avoid following redirects to unvalidated hosts.
- Treat SAML metadata configuration as untrusted input:
- Require strict validation and normalization of URLs before storing or using them.
- Prefer configuration models that select from predefined providers instead of arbitrary URLs where feasible.
How teams detect issues like this
Detection and monitoring can focus on both code-level patterns and runtime behavior:
- Static analysis and code review:
- Flag uses of HTTP client libraries (e.g., requests.get) where the URL comes from request data, user-controlled configuration fields, or database values not constrained by validation.
- Look for outbound request code paths lacking scheme checks, hostname/IP allow/deny logic, or URL normalization.
- Review viewsets and serializers responsible for SAML provider configuration to ensure they enforce URL constraints.
- Automated policy enforcement:
- Incorporate security linters or SAST tools that include SSRF-specific rules into CI/CD.
- Enforce architectural rules (e.g., "no direct HTTP calls to arbitrary URLs from web handlers") via code owners and policy checks.
- Operational monitoring:
- Examine outbound traffic logs for unusual destinations, such as internal IP ranges, metadata services, or unexpected ports.
- Use application logs to correlate sync_provider_data calls with target URLs and flag anomalous patterns.

