-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormatException on the login screen when sending non-boolean value for RememberMe #14792
Comments
Do you mean editing the value in the browser inspector? |
Yep! |
I might come back to this one I have some time, I'm busy with some other PRs |
I could think of a thousand ways to trigger exceptions at different levels of Orchard and its libraries (including aspnet). Having these exception in logging should be limited by log level configuration, not accepting invalid inputs. (and here it's 'false' but it's still accepting an invalid input). This is assuming the issue is only because of logging, not a security problem. |
This is not an issue with logging. Before my fix, you got an HTTP 500 due to the exception being thrown on invalid input, and that not being handled. Now there's a validation error (invalid input is not accepted) instead. |
Describe the bug
If on the login screen any non-boolean value (e.g. "1", "asdfasd") is set for the
RememberMe
input field, then you'll get the below exception.This is of course not what a normal user would do, but is surfaced by the pentest attacks of ZAP and we see it frequently on our production sites too (most possibly due to similar attempted attacks). So, adding input validation here would be necessary to avoid 500s.
To Reproduce
value
attribute ofRememberMe
to anything but "true" or "false" from e.g. the Dev Tools.Expected behavior
A validation error appears, perhaps with a 4xx error, but not with a 5xxx one.
The text was updated successfully, but these errors were encountered: