CVE-2026-27128
JSON

6.9medium

Craft CMS's race condition in Token Service potentially allows for token usage greater than the token limit

Severity
6.9medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.19% (higher than 9% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-6fx5-5cw5-4897

Description

Craft is a content management system (CMS). In versions 4.5.0-RC1 through 4.16.18 and 5.0.0-RC1 through 5.8.22, a Time-of-Check-Time-of-Use (TOCTOU) race condition exists in Craft CMS’s token validation service for tokens that explicitly set a limited usage. The `getTokenRoute()` method reads a token’s usage count, checks if it’s within limits, then updates the database in separate non-atomic operations. By sending concurrent requests, an attacker can use a single-use impersonation token multiple times before the database update completes. To make this work, an attacker needs to obtain a valid user account impersonation URL with a non-expired token via some other means and exploit a race condition while bypassing any rate-limiting rules in place. For this to be a privilege escalation, the impersonation URL must include a token for a user account with more permissions than the current user. Versions 4.16.19 and 5.8.23 patch the issue.

Affected

Product or packageVersionsReported by
craftcms cms>= 4.5.0-RC1, < 4.16.19, >= 5.0.0-RC1, < 5.8.23CVE List
craftcms/cms (Packagist)from 4.5.0-RC1 before 4.16.19, from 5.0.0-RC1 before 5.8.23GitHub Advisory Database
craftcms craft_cmsfrom >4.5.0 before 4.16.19, from >5.0.0 before 5.8.23, 4.5.0, 5.0.0NVD

All scores

GitHub_M6.9medium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N
NVD4.8medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-367

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Craft is a content management system (CMS). In versions 4.5.0-RC1 through 4.16.18 and 5.0.0-RC1 through 5.8.22, a Time-of-Check-Time-of-Use (TOCTOU) race condition exists in Craft CMS’s token validation service for tokens that explicitly set a limited usage. The `getTokenRoute()` method reads a token’s usage count, checks if it’s within limits, then updates the database in separate non-atomic operations. By sending concurrent requests, an attacker can use a single-use impersonation token multiple times before the database update completes. To make this work, an attacker needs to obtain a valid user account impersonation URL with a non-expired token via some other means and exploit a race condition while bypassing any rate-limiting rules in place. For this to be a privilege escalation, the impersonation URL must include a token for a user account with more permissions than the current user. Versions 4.16.19 and 5.8.23 patch the issue.

GitHub Advisory Database

A Time-of-Check-Time-of-Use (TOCTOU) race condition exists in Craft CMS’s token validation service for tokens that explicitly set a limited usage. The getTokenRoute() method reads a token’s usage count, checks if it’s within limits, then updates the database in separate non-atomic operations. By sending concurrent requests, an attacker can use a single-use impersonation token multiple times before the database update completes.

To make this work, an attacker needs to obtain a valid user account impersonation URL with a non-expired token via some other means and exploit a race condition while bypassing any rate-limiting rules in place.

For this to be a privilege escalation, the impersonation URL must include a token for a user account with more permissions than the current user.

References

https://github.com/craftcms/cms/commit/3e4afe18279951c024c64896aa2b93cda6d95fdf

NVD (es)

Craft es un sistema de gestión de contenidos (CMS). En las versiones 4.5.0-RC1 a 4.16.18 y 5.0.0-RC1 a 5.8.22, existe una condición de carrera Time-of-Check-Time-of-Use (TOCTOU) en el servicio de validación de tokens de Craft CMS para tokens que establecen explícitamente un uso limitado. El método `getTokenRoute()` lee el recuento de uso de un token, verifica si está dentro de los límites y luego actualiza la base de datos en operaciones no atómicas separadas. Al enviar solicitudes concurrentes, un atacante puede usar un token de suplantación de un solo uso varias veces antes de que se complete la actualización de la base de datos. Para que esto funcione, un atacante necesita obtener una URL de suplantación de cuenta de usuario válida con un token no caducado por otros medios y explotar una condición de carrera mientras elude cualquier regla de limitación de velocidad existente. Para que esto sea una escalada de privilegios, la URL de suplantación debe incluir un token para una cuenta de usuario con más permisos que el usuario actual. Las versiones 4.16.19 y 5.8.23 aplican un parche al problema.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-27128 changed 2026-02-28CVE Terms of Use
GitHub Advisory DatabaseGHSA-6fx5-5cw5-4897 changed 2026-02-24CC-BY-4.0
NVDCVE-2026-27128 changed 2026-06-17Public domain