mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-08 16:49:02 +03:00
[GH-ISSUE #641] Feature request: Add option --allow-hash to allow/disallow file hashing
#390
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TransparentLC on GitHub (Oct 27, 2025).
Original GitHub issue: https://github.com/sigoden/dufs/issues/641
Specific Demand
If I use dufs to serve files in GBs (such as datasets, software installers, Ubuntu CD images), request file hashing concurrently will consume significant CPU resources and potentially enabling exploitation for denial-of-service attacks.
For example, the following command will end up a loadavg over 180 on my 16-cores server.
I believe file hashing is not a core function of a static file server. If I need a convenient way to verify files, serving a SHA256SUMS with the file might be a better approach. Therefore, I suggest making file hashing an optional configuration setting, which would also prevent the previously mentioned DoS attack.
Implement Suggestion
Add option
--allow-hashin the CLI, environment variable and configuration file. If file hashing is not enabled, request with querystring paramhashshould serve file normally or return a 403 forbidden.(I am happy to submit pull requests)
Regardless of whether this feature request will be accepted, if you are using a reverse proxy, you can also configure it to disable file hashing. An example of nginx: