7.0high
OpenRemote has Improper Access Control via updateUserRealmRoles function
- Severity
- 7.0high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.30% (higher than 23% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-49vv-25qx-mg44
Description
OpenRemote is an open-source internet-of-things platform. Prior to version 1.22.1, a user who has `write:admin` in one Keycloak realm can call the Manager API to update Keycloak realm roles for users in another realm, including `master`. The handler uses the `{realm}` path segment when talking to the identity provider but does not check that the caller may administer that realm. This could result in a privilege escalation to `master` realm administrator if the attacker controls any user in `master` realm. Version 1.22.1 fixes the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| openremote openremote | < 1.22.1, before 1.22.1 | CVE List, NVD |
| io.openremote:openremote-manager (Maven) | before 1.22.1 | GitHub Advisory Database |
All scores
| GitHub_M | 7.0high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L |
| GitHub | 7.0high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
OpenRemote is an open-source internet-of-things platform. Prior to version 1.22.1, a user who has `write:admin` in one Keycloak realm can call the Manager API to update Keycloak realm roles for users in another realm, including `master`. The handler uses the `{realm}` path segment when talking to the identity provider but does not check that the caller may administer that realm. This could result in a privilege escalation to `master` realm administrator if the attacker controls any user in `master` realm. Version 1.22.1 fixes the issue.
GitHub Advisory Database
Summary
A user who has write:admin in one Keycloak realm can call the Manager API to update Keycloak realm roles for users in another realm, including master. The handler uses the {realm} path segment when talking to the identity provider but does not check that the caller may administer that realm. This could result in a privilege escalation to master realm administrator if the attacker controls any user in master realm.
Details
In manager/src/main/java/org/openremote/manager/security/UserResourceImpl.java, there is no check to validate if the caller should be able to administer a realm they're trying to update.
@Override
public void updateUserRealmRoles(RequestParams requestParams, String realm, String userId, String[] roles) {
try {
identityService.getIdentityProvider().updateUserRealmRoles(
realm,
userId,
roles);
} catch (ClientErrorException ex) {
ex.printStackTrace(System.out);
throw new WebApplicationException(ex.getCause(), ex.getResponse().getStatus());
} catch (Exception ex) {
throw new WebApplicationException(ex);
}
}
PoC
- Create a new Keycloak realm other than
master. Add a user and grant that user the OpenRemote client rolewrite:admin. Remember the realm name (call itNEW_REALM). - In Keycloak realm
master, pick a low-privilege user (noadminrealm role). Copy that user’s UUID (<master-user-uuid>). - Authenticate as the user from step 1 and obtain a Bearer access token (
<token>) forNEW_REALM. - Replace placeholders and run:
curl -k -X PUT "https://<host>/api/<NEW_REALM>/user/master/userRealmRoles/<master-user-uuid>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '["admin"]'
- In the Keycloak Admin Console, realm master, that user, Role mapping. Confirm the admin realm role is assigned.
Impact
An attacker with the OpenRemote client role write:admin in any realm can call this API with {realm} set to another realm (for example master) and change Keycloak realm roles for users there. That can grant admin on master to a user UUID they target, which gives Keycloak administrator access for the master realm.
NVD (es)
OpenRemote es una plataforma de internet de las cosas de código abierto. Antes de la versión 1.22.1, un usuario que tiene ’write:admin’ en un reino de Keycloak puede llamar a la API del Gestor para actualizar los roles del reino de Keycloak para usuarios en otro reino, incluyendo ’master’. El gestor utiliza el segmento de ruta ’{realm}’ al comunicarse con el proveedor de identidad, pero no verifica que el llamante pueda administrar ese reino. Esto podría resultar en una escalada de privilegios a administrador del reino ’master’ si el atacante controla a cualquier usuario en el reino ’master’. La versión 1.22.1 corrige el problema.
References
| https://github.com/openremote/openremote/security/advisories/GHSA-49vv-25qx-mg44 | exploit, vendor-advisory, web | |
| https://github.com/openremote/openremote/releases/tag/1.22.1 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-41166 | advisory | |
| https://github.com/openremote/openremote | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-41166 changed 2026-04-28 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-49vv-25qx-mg44 changed 2026-05-05 | CC-BY-4.0 |
| NVD | CVE-2026-41166 changed 2026-11-11 | Public domain |