CVE-2024-7318: 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.
Published Oct 14, 2024 · Updated Dec 20, 2024
Affected packages
org.keycloak:keycloak-core
- Ecosystem
- Maven
- Affected
- < 24.0.7
- Fixed in
- 24.0.7
- Check
mvn dependency:tree -Dincludes=org.keycloak:keycloak-core
org.keycloak:keycloak-core
- Ecosystem
- Maven
- Affected
- >= 25.0.0, < 25.0.4
- Fixed in
- 25.0.4
- Check
mvn dependency:tree -Dincludes=org.keycloak:keycloak-core
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
Credited to Chetven.
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/advisories/GHSA-xmmm-jw76-q7vg
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Maven vulnerabilities
All Maven entriesCVE-2024-4028
Keycloak allows cross-site scripting (XSS)
low3.8No fixFeb 18, 2025CVE-2024-10039
Keycloak mTLS Authentication Bypass via Reverse Proxy TLS Termination
high7.1Nov 25, 2024CVE-2023-6841
Keycloak Denial of Service vulnerability
high6.5Sep 10, 2024CVE-2024-7260
Keycloak Open Redirect vulnerability
medium4.4Sep 9, 2024CVE-2023-6927
keycloak-core: open redirect via "form_post.jwt" JARM response mode
medium4.6Jan 23, 2024
