I have
a Laravel app with the route
Route::put('/api/{deviceMac}/access/update','DeviceController@update');
Rule
If user A have deviceMac 000000000000
, should only be making a PUT to
http://www.app.com/api/000000000000/access/update
{deviceMac:000000000000, access: true}
If user B have deviceMac 111111111111
, should only be making a PUT to
http://www.app.com/api/111111111111/access/update
{deviceMac:111111111111, access: true}
User A should not be able hijacking the route update of other users
Hijacking
User A should have access to 000000000000
only.
Right now, User A can tweak the HTTP request and make a PUT as User B
http://www.app.com/api/111111111111/access/update
{deviceMac:111111111111, access: false}
Questions
How do I prevent other users from hijacking the request payload as other users?
Should I adjust my middleware to take care of this issue?