I have some concerns regarding the security of my data. Let's consider a scenario where I have information stored in a div like this:
<div id="Q9vX" class="mainContent" data-compname="comp1" data-user="57f70c8e78ae49d41c78876a" data-shortid="Hy85nKVR">
Now, if I were to make a post request that sends the compname
and user ID, is it possible for someone to tamper with the value of the data-user
attribute before it gets sent? Considering that I am performing database operations based on the ID within the div, there is a risk of someone altering the ID and causing the operation to be performed for an unintended user. I am using MongoDB, Heroku, and Express for my project. Although I am hesitant about using sessions due to their expiration nature, what would be the best practice in such a situation?
For instance, imagine that this particular div pertains to a review submitted by a user with the ID 57f70c8e78ae49d41c78876a
. If everything proceeds as expected and the user submits the review, it should be associated with that specific user ID. However, if someone were to manipulate the ID through tools like Firebug, could the review end up being registered under a different ID?