# Keycloak Admin API auth bypass to custom attributes

Source: https://startwithidentity.com/cves/cve-2025-13881/
Last updated: 2026-08-29
License: content by Start with Identity. Cite the source URL.

---

## What broke

The Keycloak Admin API did not enforce the intended permission on sensitive custom user attributes (CWE-266, incorrect privilege assignment). A lesser admin or a token with a narrower role could read them. Red Hat patched.

## Why it matters

Custom attributes are where people hide government IDs, recovery emails, and internal employee numbers. An Admin API authz gap is a privacy incident and a recovery-channel takeover in one.

## What to do

- Upgrade Keycloak.
- Audit who can call the Admin API. Service accounts with `realm-management` are the usual over-grant.
- Stop putting secrets in user attributes. Use a vault.

## After you patch

Patching closes the entry point. It does not remove access an attacker established through it.

- **Revoke sessions and API tokens** on the affected system rather than only resetting passwords.
- **Audit accounts, tokens, and administrative changes** made during the exposure window.
- **Rotate credentials the system stored or could reach**, including directory service accounts and integration keys. See [secrets rotation](https://startwithidentity.com/glossary/secrets-rotation/).
- **Treat the system as a pivot**: whatever it could authenticate to is in scope until you have checked it.

## Sources

- [NVD: CVE-2025-13881](https://nvd.nist.gov/vuln/detail/CVE-2025-13881)
