Advisory

RUSTSEC-2020-0029

Also known as: CVE-2020-25016, GHSA-g4rw-8m5q-6453

Summary

Allows viewing and modifying arbitrary structs as bytes

Details

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

Safety violation possible for a type wrapped in RGB<T> 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.

Severity

Critical Basis: CVSS v3 score 9.1, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Dates

Published
2020-06-14 12:00 UTC
Modified
2023-11-08 04:03 UTC

Affected packages and fixes

rgb

crates.io · All systems

Affected

  • introduced 0.5.4, fixed 0.8.20 (semver)

Fixed versions

0.8.20

Fix

  • Fixed version 0.8.20
    cargo update -p rgb --precise 0.8.20

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences