@@ -23,7 +23,7 @@ key in your application configuration.
23
23
24
24
* `access_denied_url `_
25
25
* `erase_credentials `_
26
- * `hide_user_not_found `_
26
+ * `expose_security_errors `_
27
27
* `session_fixation_strategy `_
28
28
29
29
**Advanced Options **:
@@ -71,11 +71,38 @@ after authentication::
71
71
Since Symfony 7.3, ``eraseCredentials() `` methods are deprecated and are
72
72
not called if they have the ``#[\Deprecated] `` attribute.
73
73
74
+ expose_security_errors
75
+ ----------------------
76
+
77
+ **type **: ``string `` **default **: ``'none' ``
78
+
79
+ .. deprecated :: 7.3
80
+
81
+ The ``expose_security_errors `` option was introduced in Symfony 7.3
82
+
83
+ User enumeration is a common security issue where attackers infer valid usernames
84
+ based on error messages. For example, a message like "This user does not exist"
85
+ shown by your login form reveals whether a username is valid.
86
+
87
+ This options lets you hide some/all errors related to user accounts (e.g. blocked
88
+ or expired accounts) to avoid this issue. Instead, these errors will return a
89
+ generic ``BadCredentialsException ``. The value of this option can be any of:
90
+
91
+ * ``'none' ``: hides all user-related security exceptions;
92
+ * ``'account_status' ``: shows account-related exceptions (e.g. blocked or expired
93
+ accounts) but only for users who provided the correct password;
94
+ * ``'all' ``: shows all security-related exceptions.
95
+
74
96
hide_user_not_found
75
97
-------------------
76
98
77
99
**type **: ``boolean `` **default **: ``true ``
78
100
101
+ .. deprecated :: 7.3
102
+
103
+ The ``hide_user_not_found `` option was deprecated in favor of the
104
+ ``expose_security_errors `` option in Symfony 7.3.
105
+
79
106
If ``true ``, when a user is not found a generic exception of type
80
107
:class: `Symfony\\ Component\\ Security\\ Core\\ Exception\\ BadCredentialsException `
81
108
is thrown with the message "Bad credentials".
0 commit comments