RUSTSEC-2021-0053 on 2021-03-07: ‘merge_sort::merge()’ crashes with double-free for T: Drop

In the affected versions of this crate, merge_sort::merge() wildly duplicates and drops ownership of T without guarding against double-free. Due to such implementation, simply invoking merge_sort::merge() on Vec<T: Drop> can cause double free bugs.

CVE-2021-31996

GHSA-jh37-772x-4hpw

This review is from Crev, a distributed system for code reviews. To add your review, set up cargo-crev.

The current version of Algorithmica is 0.1.10.

0.1.9 (older version) Rating: Negative Thoroughness: None Understanding: Low

by yvt on 2021-10-03

This is a kitchen-sink crate that provides implementations for many well-known algorithms.

algorithmica::sort::merge_sort provides unsound functions. This issue was reported by the GitHub issue #1 and an advisory issued on Mar 7, 2021. The author closed the issue on Jun 16 without providing any explanations or fixes.


Lib.rs has been able to verify that all files in the crate's tarball are in the crate's repository. Please note that this check is still in beta, and absence of this confirmation does not mean that the files don't match.

Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories, so there is a possibility that published crates have a misleading repository URL, or contain different code from the code in the repository.

To review the actual code of the crate, it's best to use cargo crev open algorithmica. Alternatively, you can download the tarball of algorithmica v0.1.10 or view the source online.