diff --git a/crates/fitsrs/RUSTSEC-0000-0000.md b/crates/fitsrs/RUSTSEC-0000-0000.md new file mode 100644 index 0000000000..1a3267ffb0 --- /dev/null +++ b/crates/fitsrs/RUSTSEC-0000-0000.md @@ -0,0 +1,22 @@ +```toml +[advisory] +id = "RUSTSEC-0000-0000" +package = "fitsrs" +date = "2024-12-28" +url = "https://github.com/cds-astro/fitsrs/issues/5" +references = ["https://github.com/betrusted-io/xous-core/pull/411"] +categories = [] +keywords = [] +informational = "unsound" + +[versions] +patched = [] +``` + +# Unsound mutable aliasing to immutable data + +There are muliple cases in the codebase, like the [snippet referenced in the issue](https://github.com/cds-astro/fitsrs/blob/5609d8fbb2add2cea207f20ee89117d1f7100b87/src/hdu/data/image.rs#L43-L46), where `unsafe` is used to circumvent aliasing rules. + +Immutable inputs are being cast to mutable inputs by using a combination of raw pointers and `UnsafeCell` as intermediate types. + +This is undefined behaviour by itself, but in some cases also results in multiple references - some immutable and some mutable - referring to the same input.