OutSystems Security: How did the user bypass my form validations?
This article will be divided into 2 parts:
You must be wondering "how crazy is this Lucas? You said front end twice, and is there a way to do two validations just on the front end?".
Yes my friend, there is, imagine that your application has a form, be it any mandatory field for the user to enter information.
Note that the first 3 fields have a red asterisk, indicating that the fields are mandatory.
In the studio I configured it as follows:
To recap, on the screen, in my form I selected the mandatory inputs as "true" and in the action of saving the information I kept the IF that validates the form.
As it stands, if the user tries to pass in blank information, this is what happens:
See Lucas, it worked! Yes my friend, it worked.
It was expected that it would work, but you opened this article to see how the user managed to bypass this form verification mechanism.
These steps that we configure are described and in accordance with the OutSystems documentation.
And every project with mandatory forms and fields must be configured this way, but do you remember the title? "Don't trust the front end."
The front-end takes place in the user's browser, which allows the user to make some changes, such as removing "required" tags from the html before clicking submit, or manipulating the field value before submitting, among other tricks.
You might think, so in addition to these settings in the clientaction I will check variable by variable, thus creating a double check.
Now we have:
We shield validations on the client side (front-end), as the user INTERCEPTS THE REQUEST WITH THE SERVER :(
领英推荐
At this moment, the validations we carried out on the client (front-end) are not worth much, as the request was intercepted when it was being sent to the server, and the user can manipulate the data sent.
When finished manipulating the data, the user simply continues with the request and sends the data he wants to the server.
The "serveraction" that persists the data in the entity, does not validate if the parameters are blank, as IT ONLY TRUSTED THE FRONT-END.
That's why it's always important to follow OutSystems' best practices and recommendations. Your application must carry out validations on the client side (front-end) and also on the server side (back-end).
To guarantee the integrity of data receipt, because in this scenario described, the developer was only concerned with the front-end, creating the validations and did not protect the server with the same validations.
Note: Whenever there is a field where the user can enter data, it is important that you carry out the necessary validations on the client side (front-end) and also on the server side (back-end).
So, are your applications protected?
Regards
Lucas Soares
Here are some other articles where I talk about security in OutSystems:
Other sources I used to create this topic: