{"id":"CVE-2024-7318","aliases":["CVE-2024-7318","GHSA-xmmm-jw76-q7vg","BIT-KEYCLOAK-2024-7318"],"related":[],"kind":"vulnerability","state":"published","title":"Keycloak-core: one time passcode (otp) is valid longer than expiration timeseverity","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.\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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.\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.","source":"cvelist"},{"lang":"es","text":"Se encontró una vulnerabilidad en Keycloak. Los códigos OTP vencidos aún se pueden usar al usar FreeOTP cuando el período del token OTP está configurado en 30 segundos (predeterminado). En lugar de vencer y considerarse inutilizables después de unos 30 segundos, los tokens son válidos durante 30 segundos adicionales, lo que suma un total de 1 minuto. Un código de acceso de un solo uso que sea válido por más tiempo que su tiempo de vencimiento aumenta la ventana de ataque para que los actores maliciosos abusen del sistema y comprometan las cuentas. Además, aumenta la superficie de ataque porque en un momento dado, dos OTP son válidas.","source":"nvd"}],"published":"2024-09-09T18:50:36.583Z","modified":"2026-09-10T03:50:20.224Z","severity":{"scorer":"redhat","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},"severities":[{"scorer":"redhat","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N","score":4.8,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-324"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"24.0.7","status":"affected"},{"type":"semver","introduced":"25.0.0","fixed":"25.0.4","status":"affected"}],"package":"keycloak-core","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Build of Keycloak","package":"keycloak-core","cpe":"cpe:/a:redhat:build_keycloak:24","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"24.0.7-4","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat build of Keycloak 24","package":"rhbk/keycloak-operator-bundle","cpe":"cpe:/a:redhat:build_keycloak:24::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"24-16","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat build of Keycloak 24","package":"rhbk/keycloak-rhel9","cpe":"cpe:/a:redhat:build_keycloak:24::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"24-16","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat build of Keycloak 24","package":"rhbk/keycloak-rhel9-operator","cpe":"cpe:/a:redhat:build_keycloak:24::el9","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"24.0.7"}],"ecosystem":"Maven","package":"org.keycloak:keycloak-core","purl":"pkg:maven/org.keycloak/keycloak-core","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"25.0.0","status":"affected","fixed":"25.0.4"}],"ecosystem":"Maven","package":"org.keycloak:keycloak-core","purl":"pkg:maven/org.keycloak/keycloak-core","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"22.0","fixed":"24.0.7"}],"vendor":"redhat","product":"build_of_keycloak","cpe":"cpe:2.3:a:redhat:build_of_keycloak:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"22.0.0","status":"affected","fixed":"24.0.7"}],"ecosystem":"Bitnami","package":"keycloak","purl":"pkg:bitnami/keycloak","source":"bitnami"}],"references":[{"url":"https://access.redhat.com/errata/RHSA-2024:6502","tags":["issue-tracking","report","vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://access.redhat.com/errata/RHSA-2024:6503","tags":["issue-tracking","report","vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://access.redhat.com/security/cve/CVE-2024-7318","tags":["advisory","vdb-entry","vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2301876","tags":["advisory","issue-tracking","vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/keycloak/keycloak/security/advisories/GHSA-xmmm-jw76-q7vg","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-7318","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/keycloak/keycloak","tags":["package"],"sources":["ghsa"]}],"credits":["This issue was discovered by Todd Cullum (Red Hat)."],"assigner":"redhat","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-09-09T19:08:16.666Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-7318","url":"https://www.cve.org/CVERecord?id=CVE-2024-7318","licence":"CVE Terms of Use","modified":"2026-01-26T15:11:07.763Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xmmm-jw76-q7vg","url":"https://github.com/advisories/GHSA-xmmm-jw76-q7vg","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:20.224Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-7318","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-7318","licence":"Public domain","modified":"2026-06-17T08:19:50.710Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-KEYCLOAK-2024-7318","url":"https://osv.dev/vulnerability/BIT-KEYCLOAK-2024-7318","licence":"Apache-2.0","modified":"2026-09-08T08:48:06.631Z"}],"updatedAt":"2026-11-25T22:58:45.189Z","epss":{"score":0.00393,"percentile":0.35627,"date":"2026-12-01T12:00:22.000Z"}}