# CVE-2022-2237: keycloak-connect contains Open redirect vulnerability in the Node.js adapter

> An attacker can exploit an open redirect in the Keycloak Node.js Adapter's checkSso function to redirect users to malicious sites.

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 27 Mar 2023
- **Updated:** 24 Feb 2025
- **Also known as:** GHSA-59fq-727j-hm3f

## What is CVE-2022-2237?

CVE-2022-2237 is a medium-severity vulnerability in Redhat Single Sign-On, published on 27 Mar 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

A flaw was found in the Keycloak Node.js Adapter. This flaw allows an attacker to benefit from an Open Redirect vulnerability in the checkSso function.

Weakness: CWE-601 (URL Redirection to Untrusted Site)

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

2 open source packages ship an affected version, including keycloak-connect. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `keycloak-connect` | npm | All versions | 21.0.1 |
| `keycloak-connect` | npm | All versions | 21.0.1 |

Products: Redhat Keycloak Node.js Adapter, Redhat Single Sign-On.

## How do I fix CVE-2022-2237?

Upgrade keycloak-connect to 21.0.1 or later.

## Is CVE-2022-2237 being exploited?

There is no known exploitation of CVE-2022-2237 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-2237 and fix it if it is affected.

What it is: CVE-2022-2237 is a medium-severity vulnerability in Redhat Single Sign-On, published on 27 Mar 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-2237 in the wild and no public exploit code.

Affected packages and fixed versions:
- keycloak-connect (npm): affected all versions; fixed in 21.0.1
- keycloak-connect (npm): affected all versions; fixed in 21.0.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-2237/ (Markdown: https://insights.sbomify.com/CVE-2022-2237/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-2237
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-2237
- OSV: https://osv.dev/vulnerability/CVE-2022-2237

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-2237/
Summaries are generated and may contain mistakes; the official description above is the record.
