{"id":"CVE-2024-7318","published":"2024-09-09T18:50:36Z","modified":"2026-01-26T15:11:07Z","title":"Keycloak-core: one time passcode (otp) is valid longer than expiration timeseverity","vendor":"Red Hat","product":"Red Hat Build of Keycloak","tier":"tail","description":{"text":"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.\r\nA 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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.8,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00393,"percentile":0.34377,"provenance":"source"},"cwes":[{"id":"CWE-324","name":"Use of a Key Past its Expiration Date"}],"references":[{"url":"https://access.redhat.com/errata/RHSA-2024:6502","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2024:6503","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/security/cve/CVE-2024-7318","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2301876","tags":["issue-tracking","x_refsource_REDHAT"]}],"priority":{"score":10.2,"factors":[{"name":"EPSS percentile","points":6.88},{"name":"CVSS severity","points":3.36}]},"vendorSlug":"red-hat","affectedVersions":[{"vendor":null,"product":null,"versions":["< 24.0.7",">= 25.0.0, < 25.0.4"]},{"vendor":"Red Hat","product":"Red Hat build of Keycloak 24","versions":["all versions"]},{"vendor":"Red Hat","product":"Red Hat build of Keycloak 24","versions":["all versions"]},{"vendor":"Red Hat","product":"Red Hat build of Keycloak 24","versions":["all versions"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2024-09-09T19:08:16.666351Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Maven","package":"org.keycloak:keycloak-core","vulnerableRanges":["<24.0.7",">=25.0.0, <25.0.4"],"patched":["24.0.7","25.0.4"],"from":["GHSA-xmmm-jw76-q7vg"],"provenance":"source"}],"summary":{"text":"The flaw lies in the one-time passcode (OTP) handling of Red Hat Build of Keycloak: when FreeOTP is used with the default 30-second OTP token period, expired codes remain accepted for an additional 30 seconds, so each code is valid for about one minute rather than 30 seconds. An attacker with network access who can obtain or guess a recently expired OTP code can use it to authenticate during that extra window, and while this is not a practical concern for a casual observer, it does require the attacker to have network access and the ability to exploit a code within that timeframe.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:05:47Z"},"euvd":{"id":"EUVD-2024-3171","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-6927","published":"2023-12-18","fixed":"23.0.4","kev":false},{"cve":"CVE-2023-6841","published":"2024-09-10","fixed":"24.0.0","kev":false,"link":{"from":"CVE-2023-6841","to":"CVE-2024-7318","relation":"successor","confidence":"low","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.keycloak:keycloak-core","fromFixed":"24.0.0","toFixed":"24.0.7","daysApart":-1}]}},{"cve":"CVE-2024-7260","published":"2024-09-09","fixed":"24.0.7","kev":false},{"cve":"CVE-2024-7318","published":"2024-09-09","fixed":"25.0.4","kev":false}],"package":"Maven:org.keycloak:keycloak-core"}}