Skip to content

⚙️ Enable allauth enumeration prevention - #3096

Open
jefftriplett wants to merge 1 commit into
mainfrom
enable-enumeration-prevention
Open

⚙️ Enable allauth enumeration prevention#3096
jefftriplett wants to merge 1 commit into
mainfrom
enable-enumeration-prevention

Conversation

@jefftriplett

Copy link
Copy Markdown
Member

Fixes #3043.

Flips ACCOUNT_PREVENT_ENUMERATION to True, which is also the allauth default. ACCOUNT_EMAIL_VERIFICATION is already "mandatory", the precondition allauth needs — signing up with an existing address now sends mail instead of showing an error.

This closes the email vector, not the username one. Signup still has to reject a taken username, and UserDetail serves public profiles at /users//, so usernames stay confirmable. #2680 is the other half.

Two existing tests asserted the disclosure this removes, so they now assert its absence. Added a password reset test.

Copilot AI lite review requested due to automatic review settings August 14, 2026 02:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables django-allauth’s enumeration-prevention behavior by turning on ACCOUNT_PREVENT_ENUMERATION, aiming to reduce account-disclosure via signup and password reset flows.

Changes:

  • Set ACCOUNT_PREVENT_ENUMERATION = True in base settings.
  • Updated signup-related tests to assert that “email already registered” is no longer disclosed.
  • Added a password reset test to ensure unknown emails do not produce a distinguishable response.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pydotorg/settings/base.py Enables allauth enumeration prevention globally via settings.
apps/users/tests/test_views.py Updates signup duplication assertions and adds a password reset non-enumeration test.
apps/users/tests/test_forms.py Adjusts duplicate-email signup form expectations to avoid revealing a taken email.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +243 to +244
# A taken username still has to be reported. A taken email must not be:
# enumeration prevention sends mail to the address instead.
Comment on lines +247 to +248

def test_password_reset_does_not_reveal_whether_the_email_is_known(self):
@jefftriplett jefftriplett changed the title Enable allauth enumeration prevention ⚙️ Enable allauth enumeration prevention Aug 14, 2026
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.

Hardening: can we enable allauth enumeration prevention?

2 participants