-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Files:
project/memberDeclineInviteRouter.js:16project/memberUpgradeRouter.js:23
Severity: HIGH
Issue: Both endpoints use HTTP GET method for operations that modify state (delete users, update groups). This violates REST principles and HTTP specifications.
router.route("/:projectId/collaborator/:collaboratorId/decline").get(async (req, res) => {
// Deletes user from database!Impact:
- GET requests can be triggered by browser prefetch, crawlers, or link previews
- Operations not idempotent (clicking link twice causes errors)
- Violates HTTP specification (GET should be safe operations)
- Security risk: CSRF attacks possible
Fix: Change to POST or DELETE method:
router.route("/:projectId/collaborator/:collaboratorId/decline").post(async (req, res) => {
// Or .delete() for declineNote: Frontend code will also need updating to use POST instead of GET.
Metadata
Metadata
Assignees
Labels
No labels