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

Encode keys in URLs with base64url raw #477

Merged
merged 1 commit into from
Jan 2, 2023

Conversation

tock-ibm
Copy link
Contributor

Signed-off-by: Yoav Tock [email protected]

@tock-ibm tock-ibm force-pushed the keys-url-base64 branch 3 times, most recently from ce6d12e to 2877ab1 Compare December 28, 2022 12:47
liran-funaro
liran-funaro previously approved these changes Jan 2, 2023
Copy link
Contributor

@liran-funaro liran-funaro left a comment

Choose a reason for hiding this comment

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

My only note is that the issue that this PR solves can appear for every string that is passed via a rest API. This includes the keys, but also the DB name and the user ID.
I suggest modifying the API to support base64 encoding for these fields.
Otherwise, a user might be able to create a field (via post request) that it cannot access.
Alternatively, we can add a separate rest API (e.g., with a prefix /base64/...) that all names are referred to using a base64 encoding (in parallel to the plain text API).

@tock-ibm
Copy link
Contributor Author

tock-ibm commented Jan 2, 2023

My only note is that the issue that this PR solves can appear for every string that is passed via a rest API. This includes the keys, but also the DB name and the user ID. I suggest modifying the API to support base64 encoding for these fields. Otherwise, a user might be able to create a field (via post request) that it cannot access. Alternatively, we can add a separate rest API (e.g., with a prefix /base64/...) that all names are referred to using a base64 encoding (in parallel to the plain text API).

I agree that this is a potential problem to every field, and this is indicated in the issue. In other field we can enforce naming conventions that are URL and file friendly, and rejecting TXs that try and create usernames and database names that violate these restrictions, e.g. #49 #483 #482

@liran-funaro liran-funaro merged commit 1c8af68 into hyperledger-labs:main Jan 2, 2023
cendhu pushed a commit to cendhu/orion-server that referenced this pull request Jan 5, 2023
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.

2 participants