-
Notifications
You must be signed in to change notification settings - Fork 30
Security
This section has security-relevant information regarding orion.
It is assumed that when using orion, it is done so using release
mode. debug
mode is not supported, since it can impact things such as constant-time execution.
orion must never be used with opt-level = 0
, as this will, in most cases, result in variable time execution.
orion has a best-effort approach to wiping sensitive memory. There are known obstacles for ensuring effective memory wiping using Rust (from zeroize):
However, be aware that Rust's current memory semantics (e.g. move) can leave copies of data in memory, and there isn't presently a good solution for ensuring all copies of data on the stack are properly cleared.
Furthermore, orion partly uses destructors to wipe memory. According to the Rustonomicon, there are no guarantees that destructors are actually called, as safe Rust considers failing to call destructors safe, "However any program that actually manages to do such a thing is probably incorrect." (from Rustonomicon).
Due to such limitations, orion offers no guarantees that all sensitive memory is wiped.
orion also makes no attempts to avoid sensitive memory being written to the system swap space.
orion only aims to protect against timing-based side-channel vulnerabilities.
orion itself forbids the use of so-called “unsafe” code, meaning that all memory-safety guarantees provided by Rust are enforced at compile-time. However, even though orion itself does not allow unsafe code, it is used in some of its dependencies.
These are metrics that give an overview of which dependencies use unsafe code and how much:
Metric output format: x/y
x = unsafe code used by the build
y = total unsafe code found in the crate
Symbols:
:) = No `unsafe` usage found, declares #![forbid(unsafe_code)]
? = No `unsafe` usage found, missing #![forbid(unsafe_code)]
! = `unsafe` usage found
Functions Expressions Impls Traits Methods Dependency
0/0 0/0 0/0 0/0 0/0 :) orion 0.14.4
4/4 73/75 0/0 0/0 1/1 ! ├── getrandom 0.1.10
0/0 0/0 0/0 0/0 0/0 ? │ ├── cfg-if 0.1.9
2/2 24/24 0/0 0/0 5/11 ! │ └── libc 0.2.62
0/0 1/1 0/0 0/0 0/0 ! ├── subtle 2.1.1
0/0 2/2 0/0 0/0 0/0 ! └── zeroize 0.10.0
These metrics were made using cargo-geiger.
orion has not yet received any formal security audit.