-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix: Security issue - Access control of a list submission #126
Fix: Security issue - Access control of a list submission #126
Conversation
Codecov Report
@@ Coverage Diff @@
## master #126 +/- ##
==========================================
+ Coverage 71.86% 71.99% +0.13%
==========================================
Files 52 52
Lines 2847 2846 -1
==========================================
+ Hits 2046 2049 +3
+ Misses 801 797 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This pull request was already accepted, but I'll leave a comment here that it's still not clear to me if there will be any performance implications in production BioPortal. |
Context and Issue
For some time, the demo portal has returned an error when going to the ontologies page (https://demo.ontoportal.org/ontologies) when not logged in, or logged in but not admin.
In the background, that page is called
/submissions
API endpoint. Seeing the logs of the API, we see anAccess denied for this resource
. Which is returning if a user doesn't have access to something.This test is done by this function
ontologies_api/helpers/access_control_helper.rb
Lines 7 to 25 in c4baa22
It seems that it does the test by checking only the first element of the returned list (submissions in this case). So if the first element is accessible publicly we say that list is publicly accessible, and otherwise no.
The implementation has two issues
TEST_PIZZA
, but you can totally access its information with this link https://data.bioontology.org/submissions?display=description&include_status=ANY&apikey=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb and searchTEST_PIZZA
you will see my descriptionTEST PIZZA
Fix
This was already fixed in Agroportal (and originally at Ecoportal), by testing all the elements of the list to tell if a list is accessible or not.
For information, the first implementation of testing only the first element was done certainly for performance matters and does work for the other endpoints.
Changes