Skip to content

fix: prevent IDOR in admin read and password update endpoints - #1484

Open
adityaghate66-sketch wants to merge 2 commits into
idurar:masterfrom
adityaghate66-sketch:adityaMybranch
Open

fix: prevent IDOR in admin read and password update endpoints#1484
adityaghate66-sketch wants to merge 2 commits into
idurar:masterfrom
adityaghate66-sketch:adityaMybranch

Conversation

@adityaghate66-sketch

Copy link
Copy Markdown
  • Added ownership verification in updatePassword to ensure only the authenticated user can update their own password
  • Added similar check in read endpoint to prevent unauthorized access to other admin profiles
  • Both endpoints previously accepted any admin ID without verifying ownership, allowing account takeover
  • Fix enforces that req.params.id must match the authenticated user's ID before allowing operations

Description

Please provide a brief description of the changes or additions made in this pull request.

Related Issues

If this pull request is related to any issue(s), please list them here.

Steps to Test

Provide steps on how to test the changes introduced in this pull request.

Screenshots (if applicable)

If your changes include visual updates, it would be helpful to provide screenshots of the before and after.

Checklist

  • I have tested these changes
  • I have updated the relevant documentation
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the codebase
  • My changes generate no new warnings or errors
  • The title of my pull request is clear and descriptive

PR-#1470

- Added ownership verification in updatePassword to ensure only the authenticated user can update their own password
- Added similar check in read endpoint to prevent unauthorized access to other admin profiles
- Both endpoints previously accepted any admin ID without verifying ownership, allowing account takeover
- Fix enforces that req.params.id must match the authenticated user's ID before allowing operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant