iachat/app/controllers
João Pedro Baza Garcia Rodrigues 4d362da9f0
fix: Prevent user enumeration on password reset endpoint (#13528)
## Description

The current password reset endpoint returns different HTTP status codes
and messages depending on whether the email exists in the system (200
for existing emails, 404 for non-existing ones). This allows attackers
to enumerate valid email addresses via the password reset form.

## Changes

### `app/controllers/devise_overrides/passwords_controller.rb`
- Removed the `if/else` branch that returned different responses based
on email existence
- Now always returns a generic `200 OK` response with the same message
regardless of whether the email exists
- Uses safe navigation operator (`&.`) to send reset instructions only
if the user exists

### `config/locales/en.yml`
- Consolidated `reset_password_success` and `reset_password_failure`
into a single generic `reset_password` key
- New message does not reveal whether the email exists in the system

## Security Impact
- **Before**: An attacker could determine if an email was registered by
observing the HTTP status code (200 vs 404) and response message
- **After**: All requests receive the same 200 response with a generic
message, preventing user enumeration

This follows [OWASP guidelines for authentication error
messages](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html#authentication-responses).

Fixes #13527
2026-02-13 13:45:40 +05:30
..
api fix: disable email transcript for free plans (#13509) 2026-02-11 21:21:36 +05:30
concerns fix: Validate blob before attaching it to a record (#13115) 2025-12-19 19:02:21 -08:00
devise_overrides fix: Prevent user enumeration on password reset endpoint (#13528) 2026-02-13 13:45:40 +05:30
google feat: use of imap login as default if present (#10249) 2024-10-09 15:01:11 +05:30
instagram feat: Instagram reauthorization (#11221) 2025-04-03 14:30:48 +05:30
installation feat: Unify user and super admin credentials (#3830) 2022-01-25 16:58:49 -08:00
linear feat: move Linear config to installation_config (#10999) 2025-02-28 14:20:27 +05:30
microsoft feat: add Google login flow and inbox creation (#9580) 2024-06-07 16:37:46 +05:30
notion feat: Whatsapp embedded signup (#11612) 2025-07-14 21:37:06 -07:00
platform/api/v1 feat: Add route to list accounts that belongs to a platform_app (#12140) 2025-08-11 21:23:05 +02:00
public/api/v1 fix: Incorrect contact access in conversations listing (#11797) 2025-09-22 17:05:11 +05:30
shopify feat(apps): Shopify Integration (#11101) 2025-03-19 15:37:55 -07:00
super_admin Revert "chore: Upgrade Rails to 7.2.2 and update Gemfile dependencies (#11037)" 2026-02-03 21:09:42 -08:00
survey feat: Add INSTALLATION_NAME to global config (#12376) 2025-09-09 12:13:35 +05:30
tiktok feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
twilio feat: Integrate Twilio WhatsApp ProfileName for contact name resolution (#12122) 2025-08-07 12:53:39 +05:30
twitter fix: response body in twitter callback (#6907) 2023-04-14 16:48:28 +05:30
webhooks feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
android_app_controller.rb chore: Universal Linking for Android (#2324) 2021-06-02 08:46:45 -07:00
api_controller.rb chore: Upgrade to Rails 7 (#6719) 2023-05-06 10:44:52 +05:30
apple_app_controller.rb Chore: Apple site association file for deep linking (#805) 2020-05-03 12:16:11 +05:30
application_controller.rb feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
dashboard_controller.rb feat: Use amplitude for Cloud Analytics (#13217) 2026-01-09 09:32:09 -08:00
health_controller.rb feat: add lightweight /health endpoint (#13386) 2026-01-29 00:24:01 +05:30
microsoft_controller.rb chore: Automate SSL with Cloudflare (#12021) 2025-07-24 13:09:06 +04:00
oauth_callback_controller.rb refactor: use state-based authentication (#11690) 2025-06-18 17:39:06 +05:30
platform_controller.rb Chore: Inbox Members API improvements (#3008) 2021-09-14 11:55:02 +05:30
public_controller.rb fix: Locale not correct in root url when accessing help center with custom domain (#9110) 2024-03-19 18:48:59 +05:30
slack_uploads_controller.rb fix: handle active storage preview error for password protected pdfs (#11888) 2025-08-11 12:41:37 +05:30
swagger_controller.rb chore: Enable the new Rubocop rules (#7122) 2023-05-19 14:37:10 +05:30
widget_tests_controller.rb feat: Support Dark mode for the widget (#4137) 2022-04-01 20:59:03 +05:30
widgets_controller.rb feat: allow configuring attachment upload limit (#12835) 2025-11-17 14:03:08 -08:00