Strapi has issued a security advisory for CVE-2023-22894 (CVSS score 8.8, High), a cleartext storage vulnerability affecting Strapi Headless CMS versions 4.0.0 through 4.7.1. The flaw resulted in sensitive authentication parameters—including password reset tokens, private API access keys, and administrative user credentials—being stored unhashed in internal database tables and exposed through API introspection queries.

Executive Threat Summary & Exploit Landscape

Strapi is the leading open-source headless CMS, powering content delivery for global e-commerce, banking portals, and mobile application backends. When users trigger a password reset workflow, modern security standards mandate that the generated token must be cryptographically hashed (e.g., using SHA-256) before storage in the database.

Under CVE-2023-22894, Strapi stored raw reset tokens directly in the strapi_administrator and audit log tables. Any user with read-level permissions to administrative logs, or an attacker who obtained read access to database backups, could immediately extract valid reset tokens and take over super-administrator accounts without interacting with the email verification process.

Vulnerability Mechanics & Technical Root Cause (CWE-312)

The flaw resides in the authentication controller of @strapi/admin. During the forgotPassword workflow, the application generated a random hex token and persisted it directly to the resetPasswordToken column:

// Vulnerable logic in packages/core/admin/server/services/auth.js
async createResetPasswordToken(user) {
    const resetPasswordToken = crypto.randomBytes(32).toString('hex');
    // VULNERABLE: Direct cleartext persistence without cryptographic hashing
    await strapi.query('admin::user').update({
        where: { id: user.id },
        data: { resetPasswordToken },
    });
    return resetPasswordToken;
}

Because the token was never hashed, any read leak on the database or exposure through Strapi's GraphQL API plugin allowed an attacker to query resetPasswordToken, navigate to /admin/auth/reset-password?code=[TOKEN], and overwrite the administrative password.

Vulnerable Software Versions & Patch Status Matrix

Component Vulnerable Versions Patched Release Remediation Status
@strapi/strapi (Core) 4.0.0 through 4.7.1 Version 4.8.0 or later Patched
@strapi/admin 4.0.0 through 4.7.1 Version 4.8.0+ Patched
@strapi/plugin-users-permissions 4.0.0 through 4.7.1 Version 4.8.0+ Patched

Step-by-Step Remediation Playbook & Patch Commands

Administrators of Strapi applications should immediately apply the upgrade and purge residual cleartext tokens from production databases:

  1. Update Dependencies in package.json:
    # Update Strapi packages via npm
    npm install @strapi/strapi@^4.8.0 @strapi/plugin-users-permissions@^4.8.0 --save
    
    # Rebuild the admin dashboard UI bundle
    npm run build
  2. Purge Historical Reset Tokens from Database: Connect to your PostgreSQL or MySQL production database and nullify all pending reset tokens:
    -- SQL Remediation Command
    UPDATE admin_users SET reset_password_token = NULL WHERE reset_password_token IS NOT NULL;
    UPDATE up_users SET reset_password_token = NULL WHERE reset_password_token IS NOT NULL;
  3. Rotate Production API Tokens: In the Strapi Admin Panel (Settings > API Tokens), regenerate all API tokens used by external webhooks and client mobile apps.

Threat Detection, Log Auditing & Forensic Queries

Inspect database query logs and HTTP server logs for unauthorized attempts to query administrator token fields:

# Check NGINX access logs for requests querying reset password endpoints
grep -E "POST /admin/forgot-password" /var/log/nginx/access.log

# Audit GraphQL queries requesting reset token attributes
grep -i "resetPasswordToken" /var/log/strapi/app.log