Conversation
|
Thank you @kOaDT for contributing once again! 📊 PR overview
📝 Before reviewTo help maintainers review your changes efficiently, please ensure that:
✅ Continuous IntegrationTwo CI workflows will run automatically on this PR:
You can follow their progress in the Checks tab. 🤝 A note on collaborationWe value respectful and constructive interactions. Whether you are a contributor or a reviewer, please be patient, kind, and open to feedback. A maintainer will review your changes as soon as possible. If you have any questions, feel free to ask in this thread. |
d658945 to
3775f71
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a standalone writeup for the CSRF vulnerability on the admin order update endpoint (
POST/PATCH /api/orders/:id) and improves the educational debrief shown to the player when the CSRF exploit page fires successfully.The writeup walks through the lab setup, the phishing flow via
/exploits/csrf-attack.html, retrieval of the flag from the response logged to the console, an analysis of the vulnerable handler andsameSite=laxcookie, and three layered remediations (strict cookie, CSRF token with custom header,Originallowlist).The exploit page's success
alert()was rewritten so the player understands they are playing the victim Charlie Gullible (not the attacker): it explains in plain language that the page silently sent aPOSTto OopsSec Store using their existing admin session, why the cookie was attached (sameSite=lax), which server-side checks were missing (CSRF token,Origin,Referer), and where to find the flag (browser console).Type of change
Testing done
npm run devand logged in as admin./exploits/csrf-attack.htmland clicked the call-to-action button; verified thePOST /api/orders/ORD-003request fires withcredentials: "include", theauthTokencookie is attached, the order status flips toDELIVERED, and the new alert text is displayed.OSS{cr0ss_s1t3_r3qu3st_f0rg3ry}is logged to the DevTools console underFlag:after dismissing the alert.docs/) with the three referenced images (admin.png,phishing.png,pwned.png) loading fromassets/images/csrf-admin-order-update/.Checklist