CVE-2025-25298
JSON

6.3medium

Missing Maximum Password Length Validation in Strapi Password Hashing

Severity
6.3medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.40% (higher than 36% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-2cjv-6wg9-f4f3

Description

Strapi is an open source headless CMS. The @strapi/core package before version 5.10.3 does not enforce a maximum password length when using bcryptjs for password hashing. Bcryptjs ignores any bytes beyond 72, so passwords longer than 72 bytes are silently truncated. A user can create an account with a password exceeding 72 bytes and later authenticate with only the first 72 bytes. This reduces the effective entropy of overlong passwords and may mislead users who believe characters beyond 72 bytes are required, creating a low likelihood of unintended authentication if an attacker can obtain or guess the truncated portion. Long over‑length inputs can also impose unnecessary processing overhead. The issue is fixed in version 5.10.3. No known workarounds exist.

Affected

Product or packageVersionsReported by
strapi strapi< 5.10.3, before 5.10.3CVE List, NVD
@strapi/core (npm)before 5.10.3GitHub Advisory Database

All scores

GitHub_M6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Classification

CWE-261

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

What each source says

CVE List

Strapi is an open source headless CMS. The @strapi/core package before version 5.10.3 does not enforce a maximum password length when using bcryptjs for password hashing. Bcryptjs ignores any bytes beyond 72, so passwords longer than 72 bytes are silently truncated. A user can create an account with a password exceeding 72 bytes and later authenticate with only the first 72 bytes. This reduces the effective entropy of overlong passwords and may mislead users who believe characters beyond 72 bytes are required, creating a low likelihood of unintended authentication if an attacker can obtain or guess the truncated portion. Long over‑length inputs can also impose unnecessary processing overhead. The issue is fixed in version 5.10.3. No known workarounds exist.

GitHub Advisory Database

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.

NVD (es)

Strapi es un CMS headless de código abierto. El paquete @strapi/core antes de la versión 5.10.3 no impone una longitud máxima de contraseña al usar bcryptjs para el hash de contraseñas. Bcryptjs ignora cualquier byte más allá de 72, por lo que las contraseñas de más de 72 bytes se truncan silenciosamente. Un usuario puede crear una cuenta con una contraseña que exceda los 72 bytes y luego autenticarse con solo los primeros 72 bytes. Esto reduce la entropía efectiva de las contraseñas excesivamente largas y puede engañar a los usuarios que creen que se requieren caracteres más allá de los 72 bytes, creando una baja probabilidad de autenticación no intencionada si un atacante puede obtener o adivinar la porción truncada. Las entradas largas de longitud excesiva también pueden imponer una sobrecarga de procesamiento innecesaria. El problema está solucionado en la versión 5.10.3. No existen soluciones alternativas conocidas.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-25298 changed 2025-10-16CVE Terms of Use
GitHub Advisory DatabaseGHSA-2cjv-6wg9-f4f3 changed 2025-11-27CC-BY-4.0
NVDCVE-2025-25298 changed 2026-10-19Public domain