Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Add Authorization Check to saveToList #137

Conversation

AlexanderBlanchardAC
Copy link

A bug has been reported where user can add to the list of another user.
TEST PLAN:
Prior to Applying Patch:
Replicate the bug:

  1. Log into Aspen and go to your account, select Masquerade and Masquerade as Library card user number 42.
  2. Create a list.
  3. Carry out a search and select a book, click add to list. Use the developer tools to take notice of the id of the list you are adding to and note it down.
  4. End your masquerade and create a list as Aspen_Admin.
  5. Use the search function and add a different book to your list.
  6. In the Dev Tool, use the Network tab to navigate to the saveToList method and right click.
  7. Select Edit and Resend
  8. In the Network console, alter the list id number to the one you noted down and click send.
  9. Masquerade as library card number 42 again and check your list, the second book will now be part of this list too.
    APPLY THE PATCH
    Repeat the steps above, this time when you select 'send' you should see in the body section that success is false and that you are not authorized to edit this list.

Add a check to the saveToList function to ensure the person adding to the list is the user the lidt belongs to .
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