CVE-2026-27128: Craftcms/cms Craft CMS Race Condition Vulnerability

MODERATE
Advisory Identifier: GHSA-6fx5-5cw5-4897
CWE-367
Published
Advisory Summary

CVE-2026-27128 is a MODERATE craft cms race condition vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Craftcms/cms libraries in the Packagist ecosystem. The issue involves craft cms race condition in token service potentially allows for token usage greater than the token limit. Remediation is available by upgrading affected packages to version 4.16.19, 5.8.23.

CVE-2026-27128 at a Glance

CVE Identifier CVE-2026-27128
GHSA Identifier GHSA-6fx5-5cw5-4897
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Craftcms/cms
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-27128

To remediate this vulnerability, upgrade all affected Craftcms/cms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

craftcms/cms fixed: 4.16.19
Upgrade craftcms/cms to 4.16.19
craftcms/cms fixed: 5.8.23
Upgrade craftcms/cms to 5.8.23
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for craftcms/cms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-27128, inspect your project dependencies for Craftcms/cms:

inspect dependencies for craftcms/cms

Analyze the terminal output to locate any version of Craftcms/cms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.16.19), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. In Craftcms/cms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-27128 Affected Craftcms/cms Versions

2 component(s)
Fixed Versions:
4.16.195.8.23
Product / Package Ecosystem Affected Versions Fixed Version
craftcms/cms
Packagist
≥ 4.5.0-RC1
< 4.16.19
4.16.19
craftcms/cms
Packagist
≥ 5.0.0-RC1
< 5.8.23
5.8.23

References

Frequently Asked Questions

What is CVE-2026-27128?
CVE-2026-27128 is a security vulnerability in Craftcms/cms involving Craft CMS Race condition in Token Service potentially allows for token usage greater than the token limit under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Craftcms/cms versions are affected?
Affected versions include releases prior to 4.16.19, 5.8.23 across affected packages: craftcms/cms.
What version fixes CVE-2026-27128?
Upgrading to 4.16.19, 5.8.23 (or the latest patched release for your respective branch) resolves the vulnerability.
Is craftcms/cms affected?
Yes, craftcms/cms is affected in releases prior to 4.16.19, 5.8.23. Upgrade your dependency to 4.16.19, 5.8.23 or later.
What CWE is associated with CVE-2026-27128?
CVE-2026-27128 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check Packagist dependencies for CVE-2026-27128?
Run the dependency tree command: 'inspect dependencies for craftcms/cms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6fx5-5cw5-4897",
  "modified" : "2026-02-24T16:08:48Z",
  "published" : "2026-02-23T22:16:22Z",
  "aliases" : [ "CVE-2026-27128" ],
  "summary" : "Craft CMS Race condition in Token Service potentially allows for token usage greater than the token limit",
  "details" : "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.\n\nTo 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.\n\nFor this to be a privilege escalation, the impersonation URL must include a token for a user account with more permissions than the current user.\n\n## References\n\nhttps://github.com/craftcms/cms/commit/3e4afe18279951c024c64896aa2b93cda6d95fdf",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.5.0-RC1"
      }, {
        "fixed" : "4.16.19"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.16.18"
    }
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "craftcms/cms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0-RC1"
      }, {
        "fixed" : "5.8.23"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.8.22"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/security/advisories/GHSA-6fx5-5cw5-4897"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27128"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/craftcms/cms/commit/3e4afe18279951c024c64896aa2b93cda6d95fdf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/craftcms/cms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-23T22:16:22Z",
    "nvd_published_at" : "2026-02-24T03:16:02Z"
  }
}