GitHub Advisoryadvisory · crates.io

GHSA-g4rw-8m5q-6453 Out of bounds access in rgb

CRITICAL Published 2021-08-25 Modified 2023-06-13 Official page ↗
Aliases
CVE-2020-25016
Ecosystem
crates.io
Packages
rgb
Severity
Critical
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Weaknesses
CWE-119, CWE-843
Reviewed
2021-08-19

Affected packages

• crates.io rgb: >= 0.5.4, < 0.8.20 → fixed in 0.8.20

Description

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.

Related

Alias · CVE (1)

  • CVE-2020-25016 A safety violation was discovered in the rgb crate before 0.8.20 for Rust, leading to (for example) dereferencing of arbitrary pointers or… vulnerability

Weakness · CWE (2)

  • CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer weakness
  • CWE-843 Access of Resource Using Incompatible Type weakness

References