[GH-ISSUE #228] Is authentication done in constant time for Basic Authentication ? #117

Closed
opened 2026-04-08 16:50:26 +03:00 by zhus · 1 comment
Owner

Originally created by @perrinjerome on GitHub (Jun 2, 2023).
Original GitHub issue: https://github.com/sigoden/dufs/issues/228

Problem

If I understand correctly, when running with --auth-method basic, this

4f3a8d275b/src/auth.rs (L309-L315)

is not comparing the password using constant time, which is not recommended according to
https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html#compare-password-hashes-using-safe-functions

Maybe something like https://docs.rs/constant_time_eq/latest/constant_time_eq/ could be used instead, but I don't know much about rust ecosystem so I am can not really recommend any implementation.

Log

If applicable, add logs to help explain your problem.

Environment:

  • Dufs version: 0.34.1
  • Browser/Webdav Info:
  • OS Info:
Originally created by @perrinjerome on GitHub (Jun 2, 2023). Original GitHub issue: https://github.com/sigoden/dufs/issues/228 **Problem** <!-- A clear and concise description of what the bug is. --> If I understand correctly, when running with `--auth-method basic`, this https://github.com/sigoden/dufs/blob/4f3a8d275b7f2904ec2e16a0a8e54e4a9bec1986/src/auth.rs#L309-L315 is not comparing the password using constant time, which is not recommended according to https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html#compare-password-hashes-using-safe-functions Maybe something like https://docs.rs/constant_time_eq/latest/constant_time_eq/ could be used instead, but I don't know much about rust ecosystem so I am can not really recommend any implementation. **Log** If applicable, add logs to help explain your problem. **Environment:** - Dufs version: 0.34.1 - Browser/Webdav Info: - OS Info:
zhus closed this issue 2026-04-08 16:50:26 +03:00
Author
Owner

@sigoden commented on GitHub (Jun 2, 2023):

This is over optimized

<!-- gh-comment-id:1573784178 --> @sigoden commented on GitHub (Jun 2, 2023): This is over optimized
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#117