Skip to content

Email verification permanently disabled: isEmailVerified hardcoded to true on registration #717

Description

@anshul23102

Summary

In backend/controllers/authController.js, the user creation block unconditionally sets isEmailVerified: true with an inline comment acknowledging this is a temporary workaround:

isEmailVerified: true, // skip email verification until SMTP is configured

This means:

  • Anyone can register with any email address (including addresses they do not own).
  • The email verification flow (verifyEmail, resendVerificationEmail) is fully implemented but unreachable in practice.
  • There is no mechanism to ensure a user owns the email they registered with.

Impact

  • Account enumeration: an attacker can register with victim@company.com and use the account.
  • Reputation: malicious users register with real-looking email addresses for social engineering.
  • Data integrity: user profiles contain unverified email addresses used for contact and notifications.

Suggested Fix

Configure an SMTP provider (Resend, Postmark, or Nodemailer with a real account) and remove the hardcoded bypass:

// Remove this line:
isEmailVerified: true,

// Replace with:
isEmailVerified: false,
emailVerificationToken: crypto.randomBytes(32).toString('hex'),
emailVerificationExpires: new Date(Date.now() + 24 * 60 * 60 * 1000),

Then call sendVerificationEmail after user creation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions