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

middleware/requestid: mention that the default UUID generator exposes the number of requests made to the server #2241

Conversation

leonklingele
Copy link
Member

No description provided.

@leonklingele
Copy link
Member Author

For v3, I'd make the utils.UUIDv4 generator the default. Personally, I'd recommend anyone to go for the more privacy-preserving option. Leaking the number of requests to me is quite a no-go and should not be the default choice here.

What do you think?

@ReneWerner87 ReneWerner87 merged commit 17dfcc7 into gofiber:master Dec 1, 2022
@ReneWerner87
Copy link
Member

@leonklingele you are talking about

x := atomic.AddUint64(&uuidCounter, 1)

could something be changed in the way of creation that is comparably fast but does not reveal the number of requests made ?

whereby one does not really have the start, because this is random

@leonklingele
Copy link
Member Author

leonklingele commented Dec 1, 2022 via email

@leonklingele
Copy link
Member Author

Here are some benchmarks: https://github.com/leonklingele/uuidbench#go-uuid-benchmark

It looks like switching to the construction mentioned above using Blake2s instead of SHA256 is a fast and secure alternative to UUIDv4.

@ReneWerner87
Copy link
Member

Well, is there another way that just tries to solve this security problem without causing a doubling of time?
By incrementing other parts or adding randomly when increasing the counter part

We would only have to make sure that no collisions occur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants