Commit 13ee80c
fix(security): return uniform responses on pre-auth email endpoints and remove unused routes (#41996)
## What
Makes two unauthenticated email endpoints return a consistent response
regardless of
whether an account exists, and removes two unused public routes.
## Why
`POST /users/forgotPassword` and `POST /users/resendEmailVerification`
returned
different responses for a known vs unknown email (and, for resend, also
revealed
verified state). This let an unauthenticated caller determine which
email addresses
have accounts.
## Changes
- **forgotPassword** — unknown email and over-limit both return the same
generic
success (HTTP 200), sending no email. The per-account reset limit is
unchanged.
- **resendEmailVerification** — unknown, already-verified, and
verification-disabled
cases all return the same generic success, sending no email. Adds a
per-email send
limit: over the limit it still returns the generic success (so it can't
be used to
probe), and it fails open if the limiter is unavailable so legitimate
verification
emails are never blocked.
- Removes two `permitAll` routes (`GET /users/invite/verify`, `PUT
/users/invite/confirm`)
that have no server handler.
## Testing
- Controller + service tests assert identical status and body across
known-under-limit / known-over-limit / known-verified / unknown /
verification-disabled
for both endpoints, plus the silent per-email limit and its fail-open
path.
- Relevant server module tests pass.
Fixes
https://linear.app/appsmith/issue/APP-15349/security-medium-user-enumeration-via-forgot-password
<!-- This is an auto-generated comment: Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/29493040653>
> Commit: 6017e79
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=29493040653&attempt=2"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Thu, 16 Jul 2026 19:50:33 UTC
<!-- end of auto-generated comment: Cypress test results -->
## Automation
/ok-to-test tags="@tag.All"
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 800cf99 commit 13ee80c
8 files changed
Lines changed: 718 additions & 64 deletions
File tree
- app/server/appsmith-server/src
- main/java/com/appsmith/server
- configurations
- constants
- ratelimiting
- services/ce
- test/java/com/appsmith/server
- controllers
- services
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
223 | 221 | | |
224 | 222 | | |
225 | 223 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
Lines changed: 72 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
230 | 234 | | |
231 | 235 | | |
232 | 236 | | |
| |||
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
243 | | - | |
244 | | - | |
245 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
246 | 261 | | |
247 | | - | |
| 262 | + | |
248 | 263 | | |
249 | 264 | | |
250 | 265 | | |
| |||
269 | 284 | | |
270 | 285 | | |
271 | 286 | | |
272 | | - | |
273 | | - | |
274 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
275 | 299 | | |
276 | 300 | | |
| 301 | + | |
| 302 | + | |
277 | 303 | | |
278 | | - | |
| 304 | + | |
279 | 305 | | |
280 | 306 | | |
281 | 307 | | |
282 | | - | |
| 308 | + | |
283 | 309 | | |
284 | 310 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 311 | + | |
292 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
293 | 319 | | |
| 320 | + | |
294 | 321 | | |
295 | 322 | | |
296 | 323 | | |
| |||
878 | 905 | | |
879 | 906 | | |
880 | 907 | | |
881 | | - | |
882 | | - | |
883 | | - | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
884 | 915 | | |
885 | | - | |
| 916 | + | |
| 917 | + | |
886 | 918 | | |
887 | 919 | | |
888 | | - | |
| 920 | + | |
889 | 921 | | |
890 | | - | |
| 922 | + | |
891 | 923 | | |
892 | 924 | | |
893 | 925 | | |
| |||
936 | 968 | | |
937 | 969 | | |
938 | 970 | | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
939 | 987 | | |
940 | 988 | | |
941 | 989 | | |
| |||
Lines changed: 106 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
0 commit comments