Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. rgb
  4. ›
  5. CVE-2020-25016

CVE-2020-25016: Out of bounds access in rgb

August 25, 2021 (updated June 13, 2023)

Affected versions of rgb crate allow viewing and modifying data of any type T wrapped in RGB as bytes, and do not correctly constrain RGB and other wrapper structures to the types for which it is safe to do so.

Safety violation possible for a type wrapped in RGB and similar wrapper structures:

  • If T contains padding, viewing it as bytes may lead to exposure of contents of uninitialized memory.
  • If T contains a pointer, modifying it as bytes may lead to dereferencing of arbitrary pointers.
  • Any safety and/or validity invariants for T may be violated.

The issue was resolved by requiring all types wrapped in structures provided by RGB crate to implement an unsafe marker trait.

References

  • github.com/advisories/GHSA-g4rw-8m5q-6453
  • github.com/kornelski/rust-rgb
  • github.com/kornelski/rust-rgb/issues/35
  • nvd.nist.gov/vuln/detail/CVE-2020-25016
  • rustsec.org/advisories/RUSTSEC-2020-0029.html

Code Behaviors & Features

Detect and mitigate CVE-2020-25016 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.5.4 before 0.8.20

Fixed versions

  • 0.8.20

Solution

Upgrade to version 0.8.20 or above.

Impact 9.1 CRITICAL

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

Learn more about CVSS

Weakness

  • CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
  • CWE-843: Access of Resource Using Incompatible Type ('Type Confusion')

Source file

cargo/rgb/CVE-2020-25016.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:41 +0000.