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

Dont leak info on UpdateSpace #3449

Merged
merged 1 commit into from
Nov 11, 2022
Merged

Dont leak info on UpdateSpace #3449

merged 1 commit into from
Nov 11, 2022

Conversation

kobergj
Copy link
Contributor

@kobergj kobergj commented Nov 11, 2022

There were some problems with the UpdateDrive func in decomposedfs when it is called without permission

  • When calling with empty request it would leak the complete drive info
  • When calling with non-empty request it would leak the drive name

Fixes owncloud/ocis#5030

@kobergj
Copy link
Contributor Author

kobergj commented Nov 11, 2022

Additional information. Before this PR you could do this wonderful curl 🤣

    ~/:curl -k -s -u einstein:relativity -X PATCH 'https://localhost:9200/graph/v1.0/drives/1284d238-aa92-42ce-bdc4-0b0000009157$22ee9525-6c4a-4618-9bf9-79e94ba6fbfa' -d '{}' | jq .                                                                                                     
{                                                                                                                                                                                                                                                                                         
  "error": {                                                                                                                                                                                                                                                                              
    "code": "generalException",                                                                                                                                                                                                                                                           
    "innererror": {                                                                                                                                                                                                                                                                       
      "date": "2022-11-11T10:17:14Z",                                                                                                                                                                                                                                                     
      "request-id": "jkoberg-20ud0010ge/zLOo85G2EW-000002"                                                                                                                                                                                                                                
    },                                                                                                                                                                                                                                                                                    
    "message": "gateway could not call UpdateStorageSpace:rpc error: code = Unknown desc = error: not found: Blubbspace"                                                                                                                                                                  
  }                                                                                                                                                                                                                                                                                       
}

Signed-off-by: jkoberg <jkoberg@owncloud.com>
@butonic butonic merged commit c554766 into cs3org:edge Nov 11, 2022

func (fs *Decomposedfs) checkViewerPermission(ctx context.Context, n *node.Node) error {
// to update the space name or short description we need the manager role
// current workaround: check if RemoveGrant Permission exists
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this two comment lines are leftovers

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.

3 participants