# CVE-2024-4540: Keycloak: exposure of sensitive information in pushed authorization requests (par) kc_restart cookie


- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 3 Jun 2024
- **Updated:** 9 Oct 2026
- **Also known as:** GHSA-69fp-7c8p-crjr, RHSA-2024:3566, RHSA-2024:3567, RHSA-2024:3568

## What is CVE-2024-4540?

CVE-2024-4540 is a high-severity vulnerability in Red Hat RHEL-8 based Middleware Containers, published on 3 Jun 2024. 

### Official description

A flaw was found in Keycloak in OAuth 2.0 Pushed Authorization Requests (PAR). Client-provided parameters were found to be included in plain text in the KC_RESTART cookie returned by the authorization server's HTTP response to a `request_uri` authorization request, possibly leading to an information disclosure vulnerability.

Weakness: CWE-312 (Cleartext Storage of Sensitive Information)

## Which versions are affected by CVE-2024-4540?

2 open source packages ship an affected version, including org.keycloak:keycloak-services.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.keycloak:keycloak-services` | Maven | All versions | 24.0.5 |
| `org.keycloak:keycloak-services` | Maven | All versions | 24.0.5 |
| `rh-sso7-keycloak` | Red Hat:red_hat_single_sign_on:7.6::el7 | All versions | 0:18.0.14-1.redhat_00001.1.el7sso |
| `rh-sso7-keycloak-server` | Red Hat:red_hat_single_sign_on:7.6::el7 | All versions | 0:18.0.14-1.redhat_00001.1.el7sso |
| `rh-sso7-keycloak` | Red Hat:red_hat_single_sign_on:7.6::el8 | All versions | 0:18.0.14-1.redhat_00001.1.el8sso |
| `rh-sso7-keycloak-server` | Red Hat:red_hat_single_sign_on:7.6::el8 | All versions | 0:18.0.14-1.redhat_00001.1.el8sso |
| `rh-sso7-keycloak` | Red Hat:red_hat_single_sign_on:7.6::el9 | All versions | 0:18.0.14-1.redhat_00001.1.el9sso |
| `rh-sso7-keycloak-server` | Red Hat:red_hat_single_sign_on:7.6::el9 | All versions | 0:18.0.14-1.redhat_00001.1.el9sso |

## How do I fix CVE-2024-4540?

Upgrade org.keycloak:keycloak-services to 24.0.5 or later.

## Is CVE-2024-4540 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-4540 and fix it if it is affected.

What it is: CVE-2024-4540 is a high-severity vulnerability in Red Hat RHEL-8 based Middleware Containers, published on 3 Jun 2024. 
Exploitation: There is no known exploitation of CVE-2024-4540 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.keycloak:keycloak-services (Maven): affected all versions; fixed in 24.0.5
- org.keycloak:keycloak-services (Maven): affected all versions; fixed in 24.0.5

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-2024-4540/ (Markdown: https://insights.sbomify.com/CVE-2024-4540/index.md)
```

## Sources

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

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