{
  "schema_version": "1.4.0",
  "id": "GHSA-g4rw-8m5q-6453",
  "modified": "2023-06-13T20:26:14Z",
  "published": "2021-08-25T20:45:12Z",
  "aliases": [
    "CVE-2020-25016"
  ],
  "summary": "Out of bounds access in rgb",
  "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.\n\nSafety violation possible for a type wrapped in RGB<T> and similar wrapper structures:\n\n* If T contains padding, viewing it as bytes may lead to exposure of contents of uninitialized memory.\n* If T contains a pointer, modifying it as bytes may lead to dereferencing of arbitrary pointers.\n* Any safety and/or validity invariants for T may be violated.\n\nThe issue was resolved by requiring all types wrapped in structures provided by RGB crate to implement an unsafe marker trait.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "crates.io",
        "name": "rgb"
      },
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "0.5.4"
            },
            {
              "fixed": "0.8.20"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-25016"
    },
    {
      "type": "WEB",
      "url": "https://github.com/kornelski/rust-rgb/issues/35"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/kornelski/rust-rgb"
    },
    {
      "type": "WEB",
      "url": "https://rustsec.org/advisories/RUSTSEC-2020-0029.html"
    }
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-119",
      "CWE-843"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2021-08-19T21:21:37Z",
    "nvd_published_at": null
  }
}