We have a community portal built off of Visualforce pages and on those pages we do a lot of Javascript Remoting. Due to the complexity of our org, most of the Apex classes holding these remote methods are set to "without sharing" to bypass Salesforce's profile level and object security.
For example, one remote method will accept a "userID" string passed through the remote method. Once the remote method is called, it takes that ID that is passed and performs work on it.
Our security team brought up an issue where someone can use an external tool (like Fiddler) to record the remote calls and then re-submit them. In doing so, security can pass whichever user ID they would like and our Apex remote method will take that User ID without issue (since there is no security being enforced). Normally we control which users a user can perform work on through our UI logic - but by using a tool to record and re-submit, they can bypass the UI entirely.
This means that one external user who is not in any way, shape, or form related to another can take that other's user ID and perform work on it.
Is there a way to validate a Javascript remote call is called from the Visualforce UI and not another tool? We cannot change the security here due to our org complexity so we cannot use Salesforce's security/sharing rules to tighten security. Right now our only potential solution is to go into each remote method and write custom logic to ensure the User ID being worked on is related to the user who is making the call. This is a pretty big task as we have thousands of remote calls and many of them accept parameters such as user Id, account Id, etc.
Does anyone know of anything we can do to tighten these remote calls?