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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.1
- **CVSS:** 8.1 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.87% (percentile 56, 2026-11-26)
- **CWE:** CWE-81
- **Aliases:** GHSA-9hhc-pj4w-w5rv
- **Published:** 2023-03-01T17:38:56.000Z
- **Modified:** 2026-06-17T05:20:03.403Z

## Who should check

- Projects that depend on Maven package org.keycloak:keycloak-parent (\< 20.0.5)
- Anyone running Red Hat Single Sign-On 7 (versions: see the vendor advisory)
- Anyone running Red Hat Single Sign-On 7.6 for RHEL 7 all versions
- Anyone running Red Hat Single Sign-On 7.6 for RHEL 8 all versions
- Anyone running Red Hat Single Sign-On 7.6 for RHEL 9 all versions

## 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.

## Affected and fixed versions

- Maven `org.keycloak:keycloak-parent`: affected \< 20.0.5; fixed 20.0.5 (osv)
- Red Hat Single Sign-On 7: see vendor advisory (cvelist)
- Red Hat Single Sign-On 7.6 for RHEL 7: all versions (cvelist)
- Red Hat Single Sign-On 7.6 for RHEL 8: all versions (cvelist)
- Red Hat Single Sign-On 7.6 for RHEL 9: all versions (cvelist)

## Mitigation

- Upgrade org.keycloak:keycloak-parent to 20.0.5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-4137. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-4137.md
Affected: org.keycloak:keycloak-parent < 20.0.5
Fixed in: 20.0.5

Steps:
1. Search this machine and project for org.keycloak:keycloak-parent (Maven), Red Hat Single Sign-On 7, Red Hat Single Sign-On 7.6 for RHEL 7, Red Hat Single Sign-On 7.6 for RHEL 8, Red Hat Single Sign-On 7.6 for RHEL 9: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-4137 being exploited?

There is no confirmed exploitation: CVE-2022-4137 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.87% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-4137?

High: CVSS 8.1 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2022-4137?

org.keycloak:keycloak-parent \< 20.0.5.

### Is there a fix for CVE-2022-4137?

Yes. Fixed in 20.0.5. Upgrade org.keycloak:keycloak-parent to 20.0.5 or later.

### How do I check if I'm affected by CVE-2022-4137?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://access.redhat.com/errata/RHSA-2023:1043>
- vendor: <https://access.redhat.com/errata/RHSA-2023:1044>
- vendor: <https://access.redhat.com/errata/RHSA-2023:1045>
- vendor: <https://access.redhat.com/errata/RHSA-2023:1049>
- vendor: <https://access.redhat.com/security/cve/CVE-2022-4137>
- vendor: <https://bugzilla.redhat.com/show_bug.cgi?id=2148496>
- vendor: <https://github.com/keycloak/keycloak/security/advisories/GHSA-9hhc-pj4w-w5rv>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2022-4137>
- patch: <https://github.com/keycloak/keycloak/pull/16774>
- patch: <https://github.com/keycloak/keycloak/commit/30d0e9d22dae51392e5a3748a1c68c116667359a>
- other: <https://github.com/keycloak/keycloak>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-4137>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-9hhc-pj4w-w5rv> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2022-4137> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-4137>
