9.1critical
Out of bounds access in rgb
- Severity
- 9.1critical CVSS:3.1 by NVD
- Exploit likelihood
- 1.59% (higher than 76% of CVEs)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-g4rw-8m5q-6453RUSTSEC-2020-0029
Description
A safety violation was discovered in the rgb crate before 0.8.20 for Rust, leading to (for example) dereferencing of arbitrary pointers or disclosure of uninitialized memory. This occurs because structs can be treated as bytes for read and write operations.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| rgb (crates.io) | from 0.5.4 before 0.8.20 | GitHub Advisory Database, RustSec Advisory Database |
| rgb-rust_project rgb-rust | before 0.8.20 | NVD |
All scores
| GitHub | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| RustSec Advisory Database | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| NVD | 6.4medium CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:N |
Classification
What each source says
CVE List
A safety violation was discovered in the rgb crate before 0.8.20 for Rust, leading to (for example) dereferencing of arbitrary pointers or disclosure of uninitialized memory. This occurs because structs can be treated as bytes for read and write operations.
GitHub Advisory Database
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.
RustSec Advisory Database
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
Tcontains padding, viewing it as bytes may lead to exposure of contents of uninitialized memory. - If
Tcontains a pointer, modifying it as bytes may lead to dereferencing of arbitrary pointers. - Any safety and/or validity invariants for
Tmay be violated.
The issue was resolved by requiring all types wrapped in structures provided by RGB crate to implement an unsafe marker trait.
NVD (es)
Se detectó una violación de seguridad en la crate rgb versiones anteriores a 0.8.20 para Rust, conllevando a (por ejemplo) una desreferenciación de punteros arbitrarios o una divulgación de memoria no inicializada. Esto ocurre porque las estructuras pueden ser tratadas como bytes para operaciones de lectura y escritura
References
| https://rustsec.org/advisories/RUSTSEC-2020-0029.html | advisory, vendor-advisory, web | |
| https://github.com/kornelski/rust-rgb/issues/35 | exploit, report, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2020-25016 | advisory | |
| https://github.com/kornelski/rust-rgb | package | |
| https://crates.io/crates/rgb | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-25016 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-g4rw-8m5q-6453 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2020-0029 changed 2023-11-08 | CC0-1.0 |
| NVD | CVE-2020-25016 changed 2026-06-17 | Public domain |