Commit 192d8a5
authored
[BUGFIX] Prevent infinite loop when trustedProperties validation fails (#1294)
* [BUGFIX] Prevent infinite loop when trustedProperties validation fails
If the __trustedProperties hidden property of a form is manipulated
or submit as empty, the HMAC validation fails, throwing an exception.
The normal exception handling then tries to forward the request to
the formAction, which itself also validates the HMAC. This leads to an
infinite loop which is only resolved after 100 iterations by throwing
an InfiniteLoopException.
This process takes time, therefore Powermail is vulnerable to DoS
attacks.
The change checks for a BadRequestException from the HMAC validation.
In such a case, a redirect to the (then empty) formAction is
performed and the error is logged.
Resolves: #1293
* fix: Add BadRequestException import to FormController1 parent da15520 commit 192d8a5
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
609 | 610 | | |
610 | 611 | | |
611 | 612 | | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
612 | 624 | | |
613 | 625 | | |
614 | 626 | | |
| |||
0 commit comments