GHSA-f95p-4cv5-8w8x: Linkme Linkme Fails To Ensure Slice Vulnerability

LOW
Published
Advisory Summary

GHSA-f95p-4cv5-8w8x is a LOW linkme fails to ensure slice vulnerability (General Security Weakness) affecting Linkme libraries in the crates.io ecosystem. The issue involves linkme fails to ensure slice elements match the slice's declared type. Remediation is available by upgrading affected packages to version 0.3.24.

GHSA-f95p-4cv5-8w8x at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f95p-4cv5-8w8x
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Linkme
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-f95p-4cv5-8w8x

To remediate this vulnerability, upgrade all affected Linkme dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

linkme fixed: 0.3.24
Upgrade linkme to 0.3.24
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for linkme

How to Check if You Are Affected

To determine whether your application is affected by GHSA-f95p-4cv5-8w8x, inspect your project dependencies for Linkme:

inspect dependencies for linkme

Analyze the terminal output to locate any version of Linkme in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.24), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Linkme, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-f95p-4cv5-8w8x Affected Linkme Versions

1 component(s)
Fixed Versions:
0.3.24
Product / Package Ecosystem Affected Versions Fixed Version
linkme
crates.io
< 0.3.24
0.3.24

References

Frequently Asked Questions

What is GHSA-f95p-4cv5-8w8x?
GHSA-f95p-4cv5-8w8x is a security vulnerability in Linkme involving linkme fails to ensure slice elements match the slice's declared type under General Security Weakness.
Which Linkme versions are affected?
Affected versions include releases prior to 0.3.24 across affected packages: linkme.
What version fixes GHSA-f95p-4cv5-8w8x?
Upgrading to 0.3.24 (or the latest patched release for your respective branch) resolves the vulnerability.
Is linkme affected?
Yes, linkme is affected in releases prior to 0.3.24. Upgrade your dependency to 0.3.24 or later.
What CWE is associated with GHSA-f95p-4cv5-8w8x?
GHSA-f95p-4cv5-8w8x is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-f95p-4cv5-8w8x?
Run the dependency tree command: 'inspect dependencies for linkme'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f95p-4cv5-8w8x",
  "modified" : "2024-12-04T18:26:13Z",
  "published" : "2024-12-04T18:26:13Z",
  "aliases" : [ ],
  "summary" : "linkme 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.\n\nThe 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.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "linkme"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3.24"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dtolnay/linkme/issues/82"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dtolnay/linkme"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0407.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-04T18:26:13Z",
    "nvd_published_at" : null
  }
}