Skip to content

Conversation

@stewartie4
Copy link
Contributor

@stewartie4 stewartie4 commented Jul 1, 2021

Signature checks were implemented under #66 and 0chain/gosdk#30 to fix #48
However, this has broken collaboration on the file upload endpoint (update operation) as the signature check is hardcoded against the allocation owner's public key. Therefore when a collaborator signs the request using their public key, signature verification will fail.

Fix:
If the client Id is a collaborator then use their public key (present in the request headers) to validate the signature.
If the client id is not a collaborator, we use the public key from the allocation as normal to prevent signature forgery

NB: The current codebase is very procedural so I've refactored a bit (more could be done)

@stewartie4 stewartie4 changed the title re-order signature check to support collaborators Signature check support for collaborators Jul 1, 2021
@stewartie4 stewartie4 changed the title Signature check support for collaborators Signature check support for collaborators on file update Jul 1, 2021
@Sriep Sriep merged commit 31624fe into master Jul 14, 2021
@Sriep Sriep deleted the feature/blobber-update-support-collab branch July 14, 2021 11:23
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.

Security issue: File lists can be queried and collaborators added without authentication

4 participants