Skip to content

Conversation

@lorenzulrich
Copy link
Contributor

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

@mschwemer
Copy link
Collaborator

Hi

Thanks for your contribution.

In your PR the use Statement for BadRequestException is missing. Unfortunately I cannot modify your PR. Would you mind to add it?

Review and testing is fine (after adding use).

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: in2code-de#1293
@lorenzulrich lorenzulrich force-pushed the fix/trusted-properties-validation branch from 3e7410e to 1be3c18 Compare October 13, 2025 19:18
@lorenzulrich
Copy link
Contributor Author

@mschwemer Thanks, that is done!

@lorenzulrich
Copy link
Contributor Author

Please squash when merging.

@mschwemer mschwemer merged commit 192d8a5 into in2code-de:master Oct 15, 2025
9 of 10 checks passed
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.

Submitting a form with invalid trustedProperties leads to InfiniteLoopException

2 participants