rustsec-2024-0407
Vulnerability from osv_rustsec
Published
2024-03-05 12:00
Modified
2025-10-28 06:02
Summary
Fails to ensure slice elements match the slice's declared type
Details

Affected versions allow populating a DistributedSlice of T with elements of an arbitrary other type that coerces to T. For example, elements of type &&str could end up in a slice of type [&str], since &&str coerces to &str via a deref coercion.

The flaw was corrected by implementing typechecking for distributed slice elements in such a way that coercion no longer occurs. The element's type must be a subtype of the slice's declared element type.


{
  "affected": [
    {
      "database_specific": {
        "categories": [],
        "cvss": null,
        "informational": "unsound"
      },
      "ecosystem_specific": {
        "affected_functions": null,
        "affects": {
          "arch": [],
          "functions": [],
          "os": []
        }
      },
      "package": {
        "ecosystem": "crates.io",
        "name": "linkme",
        "purl": "pkg:cargo/linkme"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0-0"
            },
            {
              "fixed": "0.3.24"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": []
    }
  ],
  "aliases": [
    "GHSA-f95p-4cv5-8w8x"
  ],
  "database_specific": {
    "license": "CC0-1.0"
  },
  "details": "Affected versions allow populating a DistributedSlice of T with elements of an\narbitrary other type that coerces to T. For example, elements of type `\u0026\u0026str`\ncould end up in a slice of type `[\u0026str]`, since `\u0026\u0026str` coerces to `\u0026str` via a\nderef coercion.\n\nThe flaw was corrected by implementing typechecking for distributed slice\nelements in such a way that coercion no longer occurs. The element\u0027s type must\nbe a subtype of the slice\u0027s declared element type.",
  "id": "RUSTSEC-2024-0407",
  "modified": "2025-10-28T06:02:18Z",
  "published": "2024-03-05T12:00:00Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://crates.io/crates/linkme"
    },
    {
      "type": "ADVISORY",
      "url": "https://rustsec.org/advisories/RUSTSEC-2024-0407.html"
    },
    {
      "type": "REPORT",
      "url": "https://github.com/dtolnay/linkme/issues/82"
    }
  ],
  "related": [],
  "severity": [],
  "summary": "Fails to ensure slice elements match the slice\u0027s declared type"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…