title: How to prevent access of other user's data in a database
body: <p>Let's say a user is logged into an application and wants to retrieve some data associated with their profile. The application does a REST call with their user ID to the backend, which in turn does an SQL query (SELECT x FROM y WHERE user_id = '...').</p>
  
  <p>The problem here is that if I know someone else's user ID, I can intercept the REST call and insert their ID into it, thereby accessing their data.</p>
  
  <p>How can this problem be avoided? </p>
  
  <p>(This question is very similar to <a href="https://stackoverflow.com/questions/20091954/how-to-prevent-user-to-access-other-users-data">How to prevent user to access other users&#39; data?</a>, but it's been 5 years so I figured I'd give it another go)</p>