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

- Severity: Medium 4.8 (CVSS:3.1, scored by redhat) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.39%, higher than 35% of CVEs (2026-12-01)
- Published: 2024-09-09T18:50:36.583Z
- Modified: 2026-09-10T03:50:20.224Z
- Also known as: GHSA-xmmm-jw76-q7vg, BIT-KEYCLOAK-2024-7318
- Weaknesses: CWE-324
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: redhat

## Description

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.

(As written by CVE List.)

## Affected

- keycloak-core: before 24.0.7; from 25.0.0 before 25.0.4
- rhbk/keycloak-operator-bundle: no versions given (not affected: from 24.0.7-4 before *)
- rhbk/keycloak-rhel9: no versions given (not affected: from 24-16 before *)
- rhbk/keycloak-rhel9-operator: no versions given (not affected: from 24-16 before *)
- org.keycloak:keycloak-core (Maven): before 24.0.7; from 25.0.0 before 25.0.4
- redhat build_of_keycloak: from 22.0 before 24.0.7
- keycloak (Bitnami): from 22.0.0 before 24.0.7

## Every score

- redhat: CVSS:3.1 4.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`
- GitHub: CVSS:3.1 4.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 4.8 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://access.redhat.com/errata/RHSA-2024:6502> (issue-tracking, report, vendor-advisory, web)
- <https://access.redhat.com/errata/RHSA-2024:6503> (issue-tracking, report, vendor-advisory, web)
- <https://access.redhat.com/security/cve/CVE-2024-7318> (advisory, vdb-entry, vendor-advisory, web)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2301876> (advisory, issue-tracking, vendor-advisory, web)
- <https://github.com/keycloak/keycloak/security/advisories/GHSA-xmmm-jw76-q7vg> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-7318> (advisory, web)
- <https://github.com/keycloak/keycloak> (package)

## Sources

- CVE List: [CVE-2024-7318](https://www.cve.org/CVERecord?id=CVE-2024-7318), CVE Terms of Use, modified 2026-01-26
- GitHub Advisory Database: [GHSA-xmmm-jw76-q7vg](https://github.com/advisories/GHSA-xmmm-jw76-q7vg), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-7318](https://nvd.nist.gov/vuln/detail/CVE-2024-7318), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-KEYCLOAK-2024-7318](https://osv.dev/vulnerability/BIT-KEYCLOAK-2024-7318), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2024-7318 · Whole record: https://cve.day/CVE-2024-7318.json · Rebuilt by cve.day 2026-11-25T22:58:45.189Z
