Skip to main content
Menu
Advisories

SSRF in RedirectionUriService (sector_identifier_uri / DCR) (conditional on DCR being enabled)

GHSA-9QW4-GWGF-3Q27Published Updated GitHub

Description

File: jans-auth-server/server/src/main/java/io/jans/as/server/service/ RedirectionUriService.java:70-101 getSectorRedirectUris fetches the URL supplied as sector_identifier_uri during Dynamic Client Registration with no scheme/host/IP validation:

    public List<String> getSectorRedirectUris(String sectorIdentiferUri) {
        ...
        jakarta.ws.rs.client.Client clientRequest = ClientBuilder.newClient();
        try {
            Response clientResponse = clientRequest
                .target(sectorIdentiferUri)
                .request().buildGet().invoke();
            ...

(Note the variable name "sectorIdentiferUri" — typo preserved from the upstream lineage; same in oxAuth and gluu4 source.) Exploit during DCR registration:

    POST /jans-auth/restv1/register
    Content-Type: application/json
    {
        "redirect_uris": ["https://attacker.example/cb"],
        "sector_identifier_uri": "[http://169.254.169.254/latest/meta-data/..](http://169.254.169.254/latest/)."
    }

The AS fetches the sector_identifier_uri from its server context. Reaches cloud metadata endpoints, internal services, or intranet hosts. Gating: DCR must be enabled (appConfiguration.getDynamicRegistrationEnabled() must return true). Many deployments enable DCR — it's a standard OP feature.

Suggested fix:

same SSRF validator as Issue 1. Both methods would benefit from a shared utility — reject non-https schemes, reject hostnames that resolve to private/link-local/loopback ranges, resolve once and pin the IP for the actual fetch to prevent DNS-rebinding TOCTOU bypass.

Affected versions

References

GitHub · JanssenProject/jans