Forum Discussion
You could add a check if the id actually exists to your code, but that will not help to make your code pass.
All in all, for 100 points that's too much code. Try this:
exports.getDraft = async (req, res) => {
return res.status(401).send("Unauthorized");
}
-> When testers fail to implement proper tests, the customer get's partially functional software. At least the tests are passed and the code can be shipped to production immediately.
That didn't seem to help either. In the post above all the code existed except lines 2-5 and line 12 was moved from basically line 2 without my additions. The addition of author to line 13 should only pull back the drafts associated to the author. This seems to be the correct implementation based upon the requirements. Every test of the code returns insecure though.
Am I still reading too much into it?
1.) Identify the forced browsing vulnerability.
2.) Add an appropriate authorization check and send a 401 for unauthorized users in the getDraft function.
- netcat11 days agoBronze II
You read only the 1st half of the first sentence of my reply, isn't it?. Continue with reading the rest, that will help.