SSRF in AuthorizeAction.getRequestedClaims (request_uri)
Description
File: jans-auth-server/server/src/main/java/io/jans/as/server/authorize/ ws/rs/AuthorizeAction.java:566-600 The OAuth /authorize endpoint has two independent consumers of the request_uri parameter:
- REST handler (
AuthorizeRestWebServiceImpl) — validates the URI viavalidateRequestUri(client, requestUri), which checks the per-client allowlist (client.getRequestUris()) and a global blocklist. This path is well-defended. - JSF page-binding (
authorize.xhtml→#{authorizeAction.requestedClaims}) — callsAuthorizeAction.getRequestedClaims()during consent rendering. This method fetchesrequest_uridirectly with no validation:
jakarta.ws.rs.client.Client clientRequest =
ClientBuilder.newClient();
Response clientResponse = clientRequest
.target(reqUriWithoutFragment)
.request().buildGet().invoke();
Result: an authenticated user can craft
/jans-auth/restv1/authorize?response_type=code&client_id=<any>
&request_uri=http://169.254.169.254/latest/meta-data/and the AS issues an outbound HTTP GET to attacker-chosen URL from its server context. Reaches cloud metadata endpoints, internal services, or intranet hosts depending on deployment. Prereqs: authenticated user account at the AS (or attacker-controlled account on any RP that allows self-registration) + any valid client_id
- the consent flow must be reached (standard OAuth/OIDC).
Suggested fix:
call validateRequestUri inside getRequestedClaims() before fetching, or refactor to share a validated Request object between the REST handler and the JSF action bean. Mirror the validation that AuthorizeRestWebServiceImpl already performs.