Skip to main content
Menu
Advisories

SSRF in AuthorizeAction.getRequestedClaims (request_uri)

GHSA-8GMM-83QV-W67GPublished Updated GitHub

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:

  1. REST handler (AuthorizeRestWebServiceImpl) — validates the URI via validateRequestUri(client, requestUri), which checks the per-client allowlist (client.getRequestUris()) and a global blocklist. This path is well-defended.
  2. JSF page-binding (authorize.xhtml → #{authorizeAction.requestedClaims}) — calls AuthorizeAction.getRequestedClaims() during consent rendering. This method fetches request_uri directly 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.

Affected versions

References

GitHub · JanssenProject/jans