---
id: "CVE-2026-118030"
kind: "vulnerability"
aliases: ["CVE-2026-118030"]
title: "Keycloak: HOTP race lets one one-time code log in twice"
severity: "medium"
cvss: 4.2
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["keycloak", "runtime", "self-hosted", "sso"]
not_affected_if: ["hotp-disabled", "managed-hosting"]
published_at: "2026-10-29T07:16:44+00:00"
first_seen_at: "2026-10-29T07:23:29+00:00"
updated_at: "2026-10-29T07:23:51+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118030", "first_seen_at": "2026-10-29T07:23:29+00:00"}]
---

# Keycloak: HOTP race lets one one-time code log in twice

Keycloak's HOTP check validates a one-time password and updates its counter in two separate steps without locking. An attacker who already has a user's password can reuse one one-time code to log in several times at once.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Confirm whether the deployment runs Keycloak and which version, for example with `kc.sh --version` or the image tag.
- Check whether HOTP is enabled as a required or optional second factor in the realm's authentication settings.

## Timeline

- 2026-10-29T07:23:29+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-118030

## From the sources

A flaw was found in the HOTP authentication mechanism of the keycloak-services component, which provides identity and access management services. The issue occurs because the system validates a one-time password and updates its internal counter in two separate steps without proper locking. An attacker with a users password could exploit this timing gap to use a single one-time code to log in multiple times simultaneously.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
