Skip to content
Fencer Vulns
medium 4.8

CVE-2024-7318 json

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

published 2024-09-09 2 y ago modified 2026-09-10 1 mo ago also BIT-keycloak-2024-7318 , EUVD-2024-3171 , GHSA-xmmm-jw76-q7vg

cvss
4.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.4%
EPSS 0.4% chance of exploitation in 30 days, percentile 33%
public exploits
0
none known

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.

Patch / fix

  • maven org.keycloak:keycloak-core 24.0.7, 25.0.4
  • bitnami keycloak 24.0.7
  • Red Hat Red Hat build of Keycloak 24 24-16, 24.0.7-4

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2024-7318 updated cvss 4.8

keycloak-core: One Time Passcode (OTP) is valid longer than expiration timeSeverity

  • Red Hat Build of Keycloak
    fixed: vendor fix RHSA-2024:6503
  • Red Hat build of Keycloak 24 rhbk/keycloak-rhel9 24-16, rhbk/keycloak-rhel9-operator 24-16, rhbk/keycloak-operator-bundle 24.0.7-4
    fixed: vendor fix RHSA-2024:6502

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
partial
Assessed
2 y ago

Exploit prediction

0.39% chance of exploitation in the next 30 days, higher than 33% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 4.8 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
GitHub 3.1 4.8 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
NVD 3.1 4.8 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
OSV 3.1 4.8 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

Affected packages

ecosystem package affected fixed in
maven org.keycloak:keycloak-core
<24.0.7
>=25.0.0, <25.0.4
24.0.7
25.0.4
bitnami keycloak
>=22.0.0, <24.0.7
24.0.7

Affected products

  • Red Hat Red Hat Build of Keycloak
  • Red Hat Red Hat build of Keycloak 24

Classification

Weakness
  • CWE-324 Use of a Key Past its Expiration Date

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.