CVE-2026-41166: OpenRemote has Improper Access Control via updateUserRealmRoles function

Published Apr 22, 2026
·
Updated

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.

340:353:manager/src/main/java/org/openremote/manager/security/UserResourceImpl.java @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 1. Create a new Keycloak realm other than master. Add a user and grant that user the OpenRemote client role write:admin. Remember the realm name (call it NEWREALM). 2. In Keycloak realm master, pick a low-privilege user (no admin realm role). Copy that user’s UUID (<master-user-uuid>). 3. Authenticate as the user from step 1 and obtain a Bearer access token (<token>) for NEWREALM. 4. Replace placeholders and run: bash curl -k -X PUT "https://<host>/api/<NEWREALM>/user/master/userRealmRoles/<master-user-uuid>" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '["admin"]' 5. 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.

Other sources

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.

MITRE

Affected Software

2 affected componentsFixes available
maven/io.openremote:openremote-manager<1.22.1
1.22.1
OpenRemote OpenRemote<1.22.1

Event History

Apr 22, 2026
Advisory Published
via GitHub·02:38 PM
Data Sourced
via GitHub·02:38 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·08:31 PM
Data Sourced
via MITRE·08:31 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-41166?

CVE-2026-41166 has a high severity rating due to its potential impact on user permissions across different realms.

2

How do I fix CVE-2026-41166?

To fix CVE-2026-41166, upgrade to version 1.22.1 of the io.openremote:openremote-manager package.

3

Who is affected by CVE-2026-41166?

Users with write:admin permissions in one Keycloak realm can potentially exploit CVE-2026-41166.

4

What is the impact of CVE-2026-41166?

The impact of CVE-2026-41166 allows unauthorized updates to Keycloak realm roles for users across different realms.

5

Is there a patch for CVE-2026-41166?

Yes, a patch is available in version 1.22.1 of the affected software.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203