Keycloaks's One Time Passcode (OTP) is valid longer than expiration timeSeverity
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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | org.keycloak:keycloak-core | < 24.0.7, >= 25.0.0, < 25.0.4 | 24.0.7, 25.0.4 |
References
- https://github.com/keycloak/keycloak/security/advisories/GHSA-xmmm-jw76-q7vg
- https://nvd.nist.gov/vuln/detail/CVE-2024-7318
- 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://github.com/keycloak/keycloak
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N- Weakness (CWE)
CWE-324- Platform
- Java / Kotlin (Maven)
- Package
org.keycloak:keycloak-core- Disclosed
- 14.10.2024
- Updated
- 11.10.2026 13:20
Sources and licenses
OSV / GitHub Advisory Database - GHSA-xmmm-jw76-q7vg - CC BY 4.0
Vulnerability history: org.keycloak:keycloak-core
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 49
- First → latest
- 10.2018 02.2025
- Without a fix
- 5
- Exploited in attacks
- 0
Severity breakdown
- Critical 3
- High 14
- Medium 31
- Low 1
Disclosures per year
- 2018: 9
- 2019: 4
- 2020: 4
- 2021: 5
- 2022: 17
- 2023: 4
- 2024: 5
- 2025: 1
- 2026: 0
-
Keycloaks's One Time Passcode (OTP) is valid longer than expiration timeSeverity this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.