# CVE-2024-7318: Keycloak-core: one time passcode (otp) is valid longer than expiration timeseverity

- Priority: **Routine**
- Reason: Not severe (CVSS 4.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-09-09 · Modified: 2026-01-26
- Aliases: CGA-4gcr-r67j-3wxf, CGA-7jmq-7w79-m6j7, CGA-8m5j-5qcw-2f2w, CGA-jqff-33pg-qhwg, CGA-m2qr-wwwj-h5px, CGA-p4hh-2gwv-8vm8, GHSA-xmmm-jw76-q7vg, BIT-keycloak-2024-7318, CGA-26c2-8x6j-hv9g, CGA-6qjx-cppm-mxjq
- Record: https://cvemate.com/vulnerability/CVE-2024-7318 · JSON: https://cvemate.com/vulnerability/CVE-2024-7318/json

## Description

```text
A vulnerability was found in Keycloak. Expired OTP codes are still usable when using FreeOTP when the OTP token period is set to 30 seconds (default). Instead of expiring and deemed unusable around 30 seconds in, the tokens are valid for an additional 30 seconds totaling 1 minute.
A one time passcode that is valid longer than its expiration time increases the attack window for malicious actors to abuse the system and compromise accounts. Additionally, it increases the attack surface because at any given time, two OTPs are valid.
```

## Signals

- CVSS: 4.8 medium (v3.1, CVE.org) CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
- EPSS: 0.393%, percentile 35.62%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- chainguard activemq-artemis-broker-kubernetes (Chainguard): All versions (No fix recorded)
- chainguard keycloak-config-cli (Chainguard): \< 6.4.0-r1
- chainguard keycloak-config-cli-compat (Chainguard): \< 6.4.0-r1
- chainguard keycloak-config-cli-iamguarded-compat (Chainguard): \< 6.4.0-r1
- wolfi keycloak-config-cli (Wolfi): \< 6.4.0-r1
- wolfi keycloak-config-cli-compat (Wolfi): \< 6.4.0-r1
- wolfi keycloak-config-cli-iamguarded-compat (Wolfi): \< 6.4.0-r1
- org.keycloak keycloak-core (Maven): \< 24.0.7 \| ≥ 25.0.0, \< 25.0.4
- redhat build\_of\_keycloak: ≥ 22.0, \< 24.0.7

## References

- <https://access.redhat.com/errata/RHSA-2024:6502>
- <https://access.redhat.com/errata/RHSA-2024:6503>
- <https://access.redhat.com/security/cve/CVE-2024-7318>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2301876>
- <https://access.redhat.com/downloads/content/package-browser/>
- <https://catalog.redhat.com/software/containers/>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/7xxx/CVE-2024-7318.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-7318>
- <https://github.com/keycloak/keycloak>
- <https://github.com/keycloak/keycloak/security/advisories/GHSA-xmmm-jw76-q7vg>

---

Data as of 2026-12-05T09:04:19.151Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
