Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. smallvec
  4. ›
  5. CVE-2018-20991

CVE-2018-20991: Double free in smallvec

August 25, 2021 (updated June 13, 2023)

If an iterator passed to SmallVec::insert_many panicked in Iterator::next, destructors were run during unwinding while the vector was in an inconsistent state, possibly causing a double free (a destructor running on two copies of the same value).

This is fixed in smallvec 0.6.3 by ensuring that the vector’s length is not updated to include moved items until they have been removed from their original positions. Items may now be leaked if Iterator::next panics, but they will not be dropped more than once.

References

  • github.com/advisories/GHSA-rxr4-x558-x7hw
  • github.com/servo/rust-smallvec
  • github.com/servo/rust-smallvec/issues/96
  • nvd.nist.gov/vuln/detail/CVE-2018-20991
  • rustsec.org/advisories/RUSTSEC-2018-0003.html

Code Behaviors & Features

Detect and mitigate CVE-2018-20991 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.3.2 before 0.6.3

Fixed versions

  • 0.6.3

Solution

Upgrade to version 0.6.3 or above.

Impact 9.8 CRITICAL

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-415: Double Free

Source file

cargo/smallvec/CVE-2018-20991.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:39 +0000.