CVE-2025-25298: @strapi/core Strapi Password Hashing Is Missing Vulnerability

MODERATE
Advisory Identifier: GHSA-2cjv-6wg9-f4f3
CWE-261
Published
Advisory Summary

CVE-2025-25298 is a MODERATE strapi password hashing is missing vulnerability (CWE-261: Weak Encoding for Password) affecting @strapi/core libraries in the npm ecosystem. The issue involves strapi password hashing is missing maximum password length validation. Remediation is available by upgrading affected packages to version 5.10.3.

CVE-2025-25298 at a Glance

CVE Identifier CVE-2025-25298
GHSA Identifier GHSA-2cjv-6wg9-f4f3
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-261: Weak Encoding for Password
Affected Product @strapi/core
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-25298

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

@strapi/core fixed: 5.10.3
npm install @strapi/core@5.10.3
Verify Direct and Transitive Dependencies

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

npm ls @strapi/core

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-25298, inspect your project dependencies using npm:

npm ls @strapi/core

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

Note: The npm ls @strapi/core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-261: Weak Encoding for Password, where obscuring a password with a trivial encoding does not protect the password. In @strapi/core, 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

## Summary Strapi's password hashing implementation using bcryptjs lacks maximum password length validation. Since bcryptjs truncates passwords exceeding 72 bytes, this creates potential vulnerabilities such as authentication bypass and performance degradation. ## POC Create an admin user with a password exceeding 72 characters like 85, Log in using only the first 72 characters of the password. Authentication is successful, confirming the issue. Proposed Solution Based on discussions: Add a maximum password length validation (72 characters) during password creation and updates for both Admin and U&P users. Truncate passwords exceeding 72 bytes on the server before passing them to bcryptjs during login. Optionally, issue a warning to users with passwords longer than 72 bytes during login, informing them of truncation. ## Impact This issue affects all Strapi installations using bcryptjs for password hashing. Until resolved, it can lead to: Authentication Bypass: Users may unknowingly set passwords exceeding 72 bytes, leading to truncated, predictable hashes. Performance Issues: Excessively long passwords can degrade server performance.

CVE-2025-25298 Affected @strapi/core Versions

1 component(s)
Fixed Versions:
5.10.3
Product / Package Ecosystem Affected Versions Fixed Version
@strapi/core
npm
< 5.10.3
5.10.3

References

Frequently Asked Questions

What is CVE-2025-25298?
CVE-2025-25298 is a security vulnerability in @strapi/core involving Strapi Password Hashing is Missing Maximum Password Length Validation under CWE-261: Weak Encoding for Password.
Which @strapi/core versions are affected?
Affected versions include releases prior to 5.10.3 across affected packages: @strapi/core.
What version fixes CVE-2025-25298?
Upgrading to 5.10.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @strapi/core affected?
Yes, @strapi/core is affected in releases prior to 5.10.3. Upgrade your dependency to 5.10.3 or later.
What CWE is associated with CVE-2025-25298?
CVE-2025-25298 is classified under CWE-261: Weak Encoding for Password (Obscuring a password with a trivial encoding does not protect the password.).
How can I check npm dependencies for CVE-2025-25298?
Run the dependency tree command: 'npm ls @strapi/core'. 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-2cjv-6wg9-f4f3",
  "modified" : "2025-11-27T08:44:59Z",
  "published" : "2025-10-16T18:41:43Z",
  "aliases" : [ "CVE-2025-25298" ],
  "summary" : "Strapi Password Hashing is Missing Maximum Password Length Validation",
  "details" : "## Summary\n\nStrapi's password hashing implementation using bcryptjs lacks maximum password length validation. Since bcryptjs truncates passwords exceeding 72 bytes, this creates potential vulnerabilities such as authentication bypass and performance degradation.\n\n## POC\nCreate an admin user with a password exceeding 72 characters like 85,\nLog in using only the first 72 characters of the password.\nAuthentication is successful, confirming the issue.\n\nProposed Solution Based on  discussions:\n\nAdd a maximum password length validation (72 characters) during password creation and updates for both Admin and U&P users.\nTruncate passwords exceeding 72 bytes on the server before passing them to bcryptjs during login.\nOptionally, issue a warning to users with passwords longer than 72 bytes during login, informing them of truncation.\n\n## Impact\nThis issue affects all Strapi installations using bcryptjs for password hashing. Until resolved, it can lead to:\nAuthentication Bypass: Users may unknowingly set passwords exceeding 72 bytes, leading to truncated, predictable hashes.\nPerformance Issues: Excessively long passwords can degrade server performance.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@strapi/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.10.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/security/advisories/GHSA-2cjv-6wg9-f4f3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-25298"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/strapi/strapi/commit/41f8cdf116f7f464dae7d591e52d88f7bfa4b7cb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/strapi/strapi"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-261" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-16T18:41:43Z",
    "nvd_published_at" : "2025-10-16T17:15:33Z"
  }
}