Keycloak-core: one time passcode (otp) is valid longer than expiration timeseverity
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | keycloak-core | before 24.0.7; 25.0.0 to before 25.0.4 | 24.0.7, 25.0.4 | Patch available | CNA |
| Red Hat | Red Hat Build of Keycloak | — | — | Not affected | CNA |
| Red Hat | Red Hat build of Keycloak 24 | — | 24.0.7-4 | Patch available | CNA |
| Red Hat | Red Hat build of Keycloak 24 | — | 24-16 | Patch available | CNA |
| Red Hat | Red Hat build of Keycloak 24 | — | 24-16 | Patch available | CNA |
| — | org.keycloak:keycloak-core (Maven) | before 24.0.7 | 24.0.7 | Patch available | GHSA-xmmm-jw76-q7vg |
| — | org.keycloak:keycloak-core (Maven) | 25.0.0 to before 25.0.4 | 25.0.4 | Patch available | GHSA-xmmm-jw76-q7vg |
- keycloak-core Vendor— Affected before 24.0.7; 25.0.0 to before 25.0.4 Fixed in 24.0.7, 25.0.4 Patch available CNA
- Red Hat Build of Keycloak VendorRed Hat Affected — Fixed in — Not affected CNA
- Red Hat build of Keycloak 24 VendorRed Hat Affected — Fixed in 24.0.7-4 Patch available CNA
- Red Hat build of Keycloak 24 VendorRed Hat Affected — Fixed in 24-16 Patch available CNA
- Red Hat build of Keycloak 24 VendorRed Hat Affected — Fixed in 24-16 Patch available CNA
- org.keycloak:keycloak-core (Maven) Vendor— Affected before 24.0.7 Fixed in 24.0.7 Patch available GHSA-xmmm-jw76-q7vg
- org.keycloak:keycloak-core (Maven) Vendor— Affected 25.0.0 to before 25.0.4 Fixed in 25.0.4 Patch available GHSA-xmmm-jw76-q7vg
Remediation
- Fix · CNA keycloak-core Fixed in 24.0.7, 25.0.4
- Fix · GHSA-xmmm-jw76-q7vg org.keycloak:keycloak-core (Maven) Fixed in 24.0.7 Advisory →
- Fix · GHSA-xmmm-jw76-q7vg org.keycloak:keycloak-core (Maven) Fixed in 25.0.4 Advisory →
Red Hat 2 advisories
- RHSA-2024:6503 Released 2024-09-09 · Red Hat rating ModerateRed Hat build of Keycloak 24.0.7 Update
- Red Hat Build of Keycloak
- RHSA-2024:6502 Released 2024-09-09 · Red Hat rating ModerateRed Hat build of Keycloak 24.0.7 Images Update
- Red Hat build of Keycloak 24 rhbk/keycloak-operator-bundle, rhbk/keycloak-rhel9, rhbk/keycloak-rhel9-operator
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Advisory ·
Red Hat Build of Keycloak, Red Hat build of Keycloak 24 — RHSA-2024:6502
3 records Highest priority Priority LOW 3 LOW
Other records, highest priority first
- TI-2024-06802 Wildfly-elytron: org.keycloak/keycloak-services: session fixation in elytron saml adaptersPriority LOW 35
- TI-2024-06725 Keycloak-core: open redirect on account pagePriority LOW 28
- Advisory ·
Red Hat Build of Keycloak, Red Hat build of Keycloak 24 — RHSA-2024:6503
3 records Highest priority Priority LOW 3 LOW
Other records, highest priority first
- TI-2024-06802 Wildfly-elytron: org.keycloak/keycloak-services: session fixation in elytron saml adaptersPriority LOW 35
- TI-2024-06725 Keycloak-core: open redirect on account pagePriority LOW 28
Vendor assessments
Red Hat
Red Hat rating: Low. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Build of Keycloak | Fixed | RHSA-2024:6503 |
| Red Hat build of Keycloak 24 | Fixed | RHSA-2024:6502 |
Timeline
- 2026-10-02 Threatist record created from CVE-2024-7318
- 2026-10-03 Alias added: GHSA-xmmm-jw76-q7vg
References
More Red Hat Build Of Keycloak vulnerabilities
- TI-2026-02223 Keycloak: keycloak: unauthorized authentication via disabled saml identity provider CVSS 3.1HIGH 8.1
- TI-2024-01049 Keycloak: path transversal in redirection validation CVSS 3.1HIGH 8.1
- TI-2026-13740 Keycloak-services: keycloak-services: saml idp-initiated broker login bypasses link-only restriction CVSS 3.1CRITICAL 9.8
- TI-2026-13741 Keycloak-services: keycloak-services: saml broker metadata import disables response signature validation CVSS 3.1CRITICAL 9.1
- TI-2026-13106 Keycloak-services: keycloak-services: dcr protocol mapper type-swap policy bypass allows privilege escalation CVSS 3.1HIGH 8.8
- TI-2026-02631 Authentication bypass in Red Hat build of Keycloak 26.2 CVSS 3.1HIGH 8.8
Sources
- CVE-2024-7318 · CVE Program
- CVE-2024-7318 · NVD
- FIRST EPSS
- GHSA-xmmm-jw76-q7vg · GitHub Advisory Database · CC BY 4.0
- CVE-2024-7318 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences