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.


Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories. There is absolutely no guarantee that the repository URL declared by the crate belongs to the crate, or that the code in the repository is the code inside the published tarball.

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.