Skip to content

fix(auth): harden pending email verification - #274

Merged
pjy008008 merged 4 commits into
developfrom
fix/customer-auth-email-flow-backend
Aug 9, 2026
Merged

fix(auth): harden pending email verification#274
pjy008008 merged 4 commits into
developfrom
fix/customer-auth-email-flow-backend

Conversation

@pjy008008

Copy link
Copy Markdown
Contributor

What changed

  • suppress duplicate signup email delivery while a registration is still pending
  • preserve the original pending password and verification token
  • enforce a 60-second resend cooldown, 5 requests per account per hour, and 20 requests per IP prefix per hour
  • purge pending registrations after 7 days with an hourly bounded batch while retaining immutable audit evidence

Why

Repeated signup requests previously replaced the pending password and verification token and sent another email. That allowed mail flooding and could let an attacker change the password associated with a victim's pending signup.

Impact

Pending users keep the original signup credentials and token. Explicit resend requests are rate-limited with HTTP 429. Expired pending personal data is removed and the email can be registered again.

Validation

  • ./gradlew --no-daemon :modules:backend-application:test :apps:backend-api:test :apps:backend-batch:test :modules:backend-persistence:test --tests com.idea2strategy.backend.persistence.identity.IdentityPersistenceIntegrationTest
  • git diff --check

…email-flow-backend

# Conflicts:
#	modules/backend-application/src/test/java/com/idea2strategy/backend/application/identity/EmailRegistrationServiceTest.java
#	modules/backend-persistence/src/test/java/com/idea2strategy/backend/persistence/identity/IdentityPersistenceIntegrationTest.java
@pjy008008
pjy008008 merged commit 317d565 into develop Aug 9, 2026
2 checks passed
@pjy008008
pjy008008 deleted the fix/customer-auth-email-flow-backend branch August 9, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant