Attacks and Exploits

A report finds an insecure direct object reference on /api/orders/{id}. Which fix BEST addresses it?

Show the answer

Correct answerA. Verify the requester is authorized for the requested object

AWhy this is right: An ownership or permission check on each requested object removes the flaw.

BWhy not this: Anti-CSRF tokens stop forged requests and do not check whether the user may access the object.

CWhy not this: Parameterized queries block SQL injection, but the lookup can still return another user's order.

DWhy not this: Output encoding counters cross-site scripting and does not control access to records.

IDOR exists because the server returns an object without checking that the requester may access it, so a server-side authorization check on every request fixes it. Parameterized queries stop SQL injection but do not decide who may see a record.