Skip to content
SSRF Disclosed report Beginner CVE-2020-10770

SSRF Keycloak before 13.0.0 - CVE-2020-10770 on https://sponsoredata.mtn.ci

Keycloak before 13.0.0 accepted an unverified URL in the OIDC request_uri parameter, so the server made an outbound request to an attacker-chosen address. An attacker could use this to make the server contact internal or external systems of their choosing.

renzi Follow

Originally disclosed on HackerOne

  • Triaged in 46 days
  • Fixed in 9 months
  • Disclosed after 2.9 years

##Vulnerable Website URL or Application: https://sponsoredata.mtn.ci

##Description of Security Issue: A flaw was found in Keycloak before 13.0.0, where it is possible to force the server to call out an unverified URL using the OIDC parameter request_uri. This flaw allows an attacker to use this parameter to execute a Server-side request forgery (SSRF) attack.

##Steps needed to reproduce bug: 1.Using Burp Suite with Burp Collaborator send this request:

imagem_2021-10-23_001239.png
imagem_2021-10-23_001239.png From the original on HackerOne

Reference:

Impact

SSRF and External Interaction

The original report as published on HackerOne, by renzi. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

Keycloak is an open source identity and access management server that implements OpenID Connect (OIDC) and OAuth 2.0 flows. One of the parameters defined by the OIDC specification for authorisation requests is request_uri, which lets a client pass a URL that the authorisation server fetches to obtain the authorisation request object, instead of sending all parameters inline. Because the server itself performs that fetch, the parameter is a natural SSRF sink if the URL is not validated.

The target in this report is https://sponsoredata.mtn.ci, an MTN Group asset. The Keycloak authorisation endpoint on that host is exposed on port 8443 under the /auth path, and the report uses the master realm with the built-in security-admin-console client.

Setup

The only tool the report names is Burp Suite, specifically Burp Collaborator, which provides an out-of-band listener that records DNS and HTTP interactions. No account, role or credential is mentioned, and none appears to be needed: the request is sent to the public authorisation endpoint. The precondition is a Keycloak instance older than 13.0.0, which the report identifies as vulnerable to CVE-2020-10770.

Finding it

The report describes the issue as a known flaw in Keycloak before 13.0.0: it is possible to force the server to call out an unverified URL using the OIDC parameter request_uri, and this allows an attacker to execute a server-side request forgery attack. The researcher's contribution is confirming that the flaw is present on the MTN host, using a Collaborator hostname as the destination so that the server's outbound request can be observed.

Exploitation

Step 1: send the authorisation request with a Collaborator request_uri

Using Burp Suite with Burp Collaborator, the researcher sends this request:

HTTP
https://sponsoredata.mtn.ci:8443/auth/realms/master/protocol/openid-connect/auth?scope=openid&response_type=code&redirect_uri=valid&state=cfx&nonce=cfx&client_id=security-admin-console&request_uri=http://0rs71imlpr20qx2svt6gfrotakga4z.burpcollaborator.net

The URL targets the standard Keycloak authorisation endpoint for the master realm. The parameters scope=openid, response_type=code, state=cfx, nonce=cfx and client_id=security-admin-console form an otherwise ordinary authorisation code request; redirect_uri=valid is a placeholder value. The decisive parameter is request_uri, which points at a Burp Collaborator hostname over plain HTTP. If the server fetches that URL, the Collaborator records the interaction.

imagem_2021-10-23_001239.png
imagem_2021-10-23_001239.png From the original on HackerOne

The report includes a screenshot alongside the request.

Root cause

The flaw is in Keycloak's handling of the request_uri parameter: the server fetches the supplied URL without verifying it, so an unauthenticated caller can make the server issue requests to arbitrary destinations. The report frames this as a defect fixed in Keycloak 13.0.0 and references CVE-2020-10770. The report does not describe the code change or any specific validation that was missing beyond the absence of verification of the URL.

Impact

The report states the impact as SSRF and external interaction. In practice, the confirmed effect is that the Keycloak server can be made to call out to a URL chosen by the attacker, which is demonstrated by the Collaborator hit. What the server returns to the caller, and whether internal services can be reached through this path, is not shown in the report. The severity recorded for the report is medium.

Fix

The report describes the flaw as affecting Keycloak before 13.0.0 and does not describe a fix.

Variants to test

  • Send the same authorisation request with request_uri pointing at a Collaborator hostname on other Keycloak deployments, checking the realm path and port used by each installation. A positive result is a DNS or HTTP interaction in Collaborator.
  • Vary the scheme and port in request_uri (for example HTTPS, or a non-standard port) to see whether the fetch still occurs. A positive result is an interaction recorded for that scheme or port.
  • Try request_uri against realms other than master and clients other than security-admin-console, since the parameter is handled by the authorisation endpoint generally. A positive result is the same out-of-band callback.

Hunting notes

Keycloak installations are easy to fingerprint from the /auth/realms/<realm>/protocol/openid-connect/auth path, and the version matters: anything before 13.0.0 is in scope for this flaw. The signal to look for during recon is an exposed Keycloak authorisation endpoint, particularly on non-standard ports such as 8443, which is what this target used. The researcher used a Collaborator hostname as the destination so that the server's outbound request could be observed.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

What happened, in plain words

A security researcher found that a login server belonging to MTN Group could be tricked into visiting a web address of the researcher's choosing. The server is a piece of software called Keycloak, which handles logging in for other applications. Keycloak has a feature where, during a login, it can be told to go and download a small file from a web address supplied in the login link. In older versions of Keycloak, the server did not check that address before fetching it. So anyone who could send a login link to the server could make the server reach out to any destination on the internet, including machines the researcher controls.

This kind of bug is called Server-Side Request Forgery, or SSRF. "Server-side" means the request is made by the server, not by your browser. "Forgery" means the request is not one the server would normally make; the attacker has forged the instruction. The researcher proved the bug by pointing the server at a special address that records every visit, and the recording showed the server had indeed called out.

The report was filed against the MTN Group programme on HackerOne, a platform where researchers report bugs to companies. The researcher is credited as renzi, the severity was recorded as medium, and the report was disclosed publicly on 26 September 2024.

The product and the feature involved

Keycloak is an open source identity and access management server. In everyday terms, it is the doorman for a set of applications: instead of every app having its own username and password system, the apps ask Keycloak to check who you are and to hand back a proof that you logged in. Keycloak speaks two related standards, OpenID Connect (OIDC) and OAuth 2.0. You do not need to know the details of either to follow this report; it is enough to know that they define a set of parameters that get passed in a web address when a login starts.

One of those parameters is called request_uri. Normally, when an application wants a user to log in, it sends the login server a bundle of settings in the link itself. request_uri is an alternative: instead of sending the settings inline, the application gives the login server a web address, and the login server goes and downloads the settings from that address. Think of it like a restaurant that will either take your order over the phone or fetch a written order from a locker you name. The second option is convenient, but it means the restaurant will walk to whatever locker address you give it. If nobody checks the address, you can send the restaurant to a locker that is not yours, or simply to a spot where you can watch it arrive.

Because the server itself performs that download, request_uri is a natural place for an SSRF bug: the attacker supplies the address, and the server does the travelling. The report describes the flaw as affecting Keycloak before 13.0.0.

The target

The target in this report is https://sponsoredata.mtn.ci, a host belonging to MTN Group. On that host, the Keycloak login endpoint is exposed on port 8443 under the /auth path. A port is a numbered door on a computer; web traffic normally uses port 443 for HTTPS, and 8443 is a common alternative. The report uses the master realm, which is Keycloak's built-in top-level area for managing the installation, and the built-in security-admin-console client, which is the application Keycloak ships for its own administration screens.

Setting up

The only tool the report names is Burp Suite, and specifically a part of it called Burp Collaborator. Burp Suite is a tool researchers use to inspect and modify web traffic. Burp Collaborator is a service that gives you a unique, throwaway web address and then tells you if anything ever tries to contact it. It is like leaving a marked envelope at a friend's house and finding out later whether anyone picked it up: you cannot see what they did with it, but you know they came.

No account, role or password is mentioned in the report, and none appears to be needed. The request is sent to a public login endpoint, so the researcher did not have to log in first. The one precondition is that the Keycloak installation is older than version 13.0.0, which the report identifies as vulnerable to CVE-2020-10770. A CVE is a public catalogue number for a known security flaw, so CVE-2020-10770 is simply the official name for this particular Keycloak bug.

Finding it

The report describes the issue as a known flaw in Keycloak before 13.0.0: it is possible to force the server to call out an unverified URL using the OIDC parameter request_uri, and this allows an attacker to execute a server-side request forgery attack. The researcher's contribution is confirming that the flaw is present on the MTN host. To do that, the researcher used a Collaborator hostname as the destination, so that the server's outbound request could be observed.

Step by step

Step 1: send the login request with a Collaborator address in request_uri

Using Burp Suite with Burp Collaborator, the researcher sends this request:

HTTP
https://sponsoredata.mtn.ci:8443/auth/realms/master/protocol/openid-connect/auth?scope=openid&response_type=code&redirect_uri=valid&state=cfx&nonce=cfx&client_id=security-admin-console&request_uri=http://0rs71imlpr20qx2svt6gfrotakga4z.burpcollaborator.net

Line by line, in plain words:

  • https://sponsoredata.mtn.ci:8443 is the address of the MTN server, with :8443 naming the port to knock on.
  • /auth/realms/master/protocol/openid-connect/auth is the path to Keycloak's login endpoint for the master realm. This is the door that starts a login.
  • ? marks the start of the parameters, the settings passed to that endpoint.
  • scope=openid tells the server which kind of access is being requested; openid is the standard scope for a login.
  • response_type=code asks the server to reply with an authorisation code, a short-lived value the application can exchange for proof of login.
  • redirect_uri=valid is a placeholder value in this report; it is not a real address, just something to fill the field.
  • state=cfx and nonce=cfx are random-looking values that the standards use to tie a request to its response and to prevent replay. Here they are fixed placeholders.
  • client_id=security-admin-console names the application making the request, in this case Keycloak's built-in admin console.
  • request_uri=http://0rs71imlpr20qx2svt6gfrotakga4z.burpcollaborator.net is the decisive part. It tells Keycloak: do not take the settings from this link, go and download them from this address instead. That address is the unique Collaborator hostname, over plain HTTP.

Everything except the last parameter forms an otherwise ordinary login request. The last parameter is the trap. If the server fetches that address, the Collaborator records the visit, and the researcher knows the server made the call.

imagem_2021-10-23_001239.png
imagem_2021-10-23_001239.png From the original on HackerOne

The report includes a screenshot alongside the request.

Why it works

The flaw is in how Keycloak handles the request_uri parameter: the server fetches the supplied address without verifying it. That means an unauthenticated caller, someone who has not logged in at all, can make the server issue requests to destinations of their choosing. The report frames this as a defect fixed in Keycloak 13.0.0 and references CVE-2020-10770. It does not describe the code change or any specific validation that was missing, beyond the absence of verification of the address.

Impact

The report states the impact as SSRF and external interaction. In practice, the confirmed effect is that the Keycloak server can be made to call out to an address chosen by the attacker, which is demonstrated by the Collaborator hit. What the server returns to the caller, and whether internal services can be reached through this path, is not shown in the report. The severity recorded for the report is medium.

The fix

The report describes the flaw as affecting Keycloak before 13.0.0 and does not describe a fix.

Variants to test

These are follow-up ideas for checking whether the same flaw exists elsewhere, each with a clear sign of success:

  • Send the same login request with request_uri pointing at a Collaborator hostname on other Keycloak deployments, checking the realm path and port used by each installation. A positive result is a DNS or HTTP interaction in Collaborator.
  • Vary the scheme and port in request_uri (for example HTTPS, or a non-standard port) to see whether the fetch still occurs. A positive result is an interaction recorded for that scheme or port.
  • Try request_uri against realms other than master and clients other than security-admin-console, since the parameter is handled by the login endpoint generally. A positive result is the same out-of-band callback.

Hunting notes

Keycloak installations are easy to spot from the /auth/realms/<realm>/protocol/openid-connect/auth path, and the version matters: anything before 13.0.0 is in scope for this flaw. The signal to look for while surveying a target is an exposed Keycloak login endpoint, particularly on non-standard ports such as 8443, which is what this target used. The researcher used a Collaborator hostname as the destination so that the server's outbound request could be observed.

Glossary

  • API: a defined way for one piece of software to ask another to do something, like a menu of requests a program will accept.
  • Authorisation code: a short-lived value a login server hands back to an application, which the application exchanges for proof that the user logged in.
  • Burp Collaborator: a service that gives you a unique web address and records any DNS or HTTP contact made to it, used to detect out-of-band requests.
  • Burp Suite: a tool for inspecting and modifying web traffic between a browser and a server.
  • Client: in OAuth and OIDC, the application that asks the login server to authenticate a user.
  • Client ID: the name an application uses to identify itself to the login server.
  • CVE: a public catalogue number for a known security vulnerability, such as CVE-2020-10770.
  • DNS: the internet's address book, which turns names like example.com into numeric addresses.
  • Endpoint: a specific address on a server that accepts a particular kind of request.
  • HTTP and HTTPS: the rules browsers and servers use to exchange web pages and data; HTTPS is the encrypted version.
  • Identity and access management: software that manages who users are and what they are allowed to do.
  • Keycloak: an open source identity and access management server that implements OIDC and OAuth 2.0.
  • Master realm: Keycloak's built-in top-level area for managing the whole installation.
  • Nonce: a one-time random value used to tie a request to its response and prevent replay.
  • OAuth 2.0: a standard for letting an application obtain limited access to a user's account on another service, without sharing the password.
  • OIDC (OpenID Connect): a standard built on OAuth 2.0 that adds a standard way to log users in and confirm who they are.
  • Out-of-band: communication that happens outside the normal request and response, such as a server contacting a separate listener.
  • Parameter: a named setting passed in a web address or request, such as client_id or request_uri.
  • Port: a numbered door on a computer that a particular service listens on; 443 is the usual HTTPS port, 8443 a common alternative.
  • Realm: in Keycloak, a separate area that holds its own users, clients and settings.
  • Redirect URI: the address an application asks the login server to send the user back to after login.
  • Request URI: an OIDC parameter that gives the login server a web address from which to download the login request settings instead of receiving them inline.
  • Scope: a parameter that states which kind of access is being requested; openid is the standard scope for a login.
  • Server-Side Request Forgery (SSRF): a bug where an attacker can make a server send a request to an address the attacker chooses.
  • State: a value passed through a login flow and returned unchanged, used to tie a request to its response.
  • Unverified URL: a web address that the server fetches without first checking that it is allowed or safe.

More by renzi

View all

8 more disclosed reports, best first.

More from MTN Group

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.