You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/12/07 10:18:03 UTC

[GitHub] fkaempfer opened a new issue #1799: Clustered purge should be restricted to admins

fkaempfer opened a new issue #1799: Clustered purge should be restricted to admins
URL: https://github.com/apache/couchdb/issues/1799
 
 
   I would say that the _purge operation should be treated similarily to _compact in terms of the security level required to run it. It is a operation that affects the structure of the database.
   
   ## Expected Behavior
   POST to the _purge endpoint should check if the user is server admin before allowing the clustered pruge to be executed
   
   ## Current Behavior
   
   Every user that has access to the db can run it:
   $ curl -X POST -H "content-type: application/json" -d "{\"test\":[\"2-eec205a9d413992850a6e32678485900\"]}" http://localhost:5984/test/_purge
   {"purge_seq":null,"purged":{"test":["2-eec205a9d413992850a6e32678485900"]}}
   
   Compared with compact:
   $ curl -X POST -H "content-type: application/json" -d {} http://localhost:5984/test/_compact
   {"error":"unauthorized","reason":"You are not a server or db admin."}
   
   
   ## Possible Solution
   Add the same security check as for _compact
   
   ## Steps to Reproduce (for bugs)
   See above
   
   ## Context
   DB that is available to users via HTTP
   
   ## Your Environment
   CouchDB 2.3.0 (master) on Linux
   
   I can create a PR for it, if you agree that we should have an admin check in place here.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services