CVE-2024-7318
Keycloaks's One Time Passcode (OTP) is valid longer than expiration timeSeverity
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.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.keycloak » keycloak-core | < 24.0.7>= 25.0.0, < 25.0.4 | 24.0.7, 25.0.4 |
Blast radius
71% of the dependent artifacts (1,130) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 13,539 |
| 2 hops | 18,824 |
| 3 hops | 14,788 |
| 4 hops | 4,257 |
| 5 hops | 2,682 |
| 6 hops | 639 |
Most used dependents
- org.keycloak » keycloak-services223 usages
- org.keycloak » keycloak-admin-client216 usages
- org.alfresco » alfresco-repository121 usages
- com.github.dasniko » testcontainers-keycloak113 usages
- org.keycloak » keycloak-authz-client98 usages
- org.keycloak » keycloak-spring-boot-starter93 usages
- org.alfresco » alfresco-remote-api67 usages
- org.keycloak » keycloak-model-jpa62 usages
- org.keycloak » keycloak-spring-security-adapter56 usages
- org.keycloak » keycloak-undertow-adapter48 usages
- org.commonjava.indy » indy-core43 usages
- city.smartb.i2 » keycloak-auth-client42 usages
- io.apicurio » apicurio-registry-common42 usages
- org.alfresco » share37 usages
- io.apicurio » apicurio-registry-utils-converter37 usages
Computed from the dependency graph of build 20261125.2201 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2024-7318 | nvd.nist.gov |
| Package | keycloak/keycloak | github.com |
| Web | keycloak/keycloak advisory GHSA-xmmm-jw76-q7vg | github.com |
| Web | errata/RHSA-2024:6502 | access.redhat.com |
| Web | errata/RHSA-2024:6503 | access.redhat.com |
| Web | security/cve/CVE-2024-7318 | access.redhat.com |
| Web | show_bug.cgi | bugzilla.redhat.com |
