-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Right now the actix-web code contains 100+ uses of unsafe. Presumably this is in order to achieve the best possible performance in hot parts of the code.
However, web servers often face the public Internet, so security is extremely important for web server implementations. This issue is especially critical for organizations that intend to use the software in large-scale production environments. One of the main reasons to choose a Rust-based HTTP implementation is the guaranteed memory safety that safe Rust provides. Unfortunately this guarantee is eroded for every use of unsafe
in the codebase. Performance isn't worth much if it comes at the cost of critical security vulnerabilities due to unsafe memory access. It's also nice to know for certain that your web server won't segfault in production.
I propose that we leave this open as a tracking issue to track design and implementation issues concerning the use of unsafe code. Some of the items that should be explored:
- Is it possible to remove any of the current uses of
unsafe
without significantly impacting performance? - Is it appropriate to remove some uses of
unsafe
even if there's a performance impact? - Is there a long-term plan to reduce or eliminate the use of unsafe code?
- Security analysis, testing, and fuzzing of the codebase
- Profiling and performance analysis to assess the impact of converting unsafe to safe code