Skip to content

Invitation Decline/Upgrade Use GET for State Changes #404

@thehabes

Description

@thehabes

Files:

  • project/memberDeclineInviteRouter.js:16
  • project/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 decline

Note: Frontend code will also need updating to use POST instead of GET.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions