GHSA-wm8x-php5-hvq6: Maligned Maligned Causes Incorrect Deallocation Vulnerability

MODERATE
Published
Advisory Summary

GHSA-wm8x-php5-hvq6 is a MODERATE maligned causes incorrect deallocation vulnerability (General Security Weakness) affecting Maligned libraries in the crates.io ecosystem. The issue involves maligned causes incorrect deallocation. Remediation is available in the latest vendor maintenance releases.

GHSA-wm8x-php5-hvq6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-wm8x-php5-hvq6
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Maligned
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-wm8x-php5-hvq6

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

maligned fixed: Latest secure release
Upgrade maligned to Latest secure release
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 maligned

How to Check if You Are Affected

To determine whether your application is affected by GHSA-wm8x-php5-hvq6, inspect your project dependencies for Maligned:

inspect dependencies for maligned

Analyze the terminal output to locate any version of Maligned in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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 Maligned, 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

`maligned::align_first` manually allocates with an alignment larger than T, and then uses `Vec::from_raw_parts` on that allocation to get a `Vec<T>`. [`GlobalAlloc::dealloc`](https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc) requires that the `layout` argument must be the same layout that was used to allocate that block of memory. When deallocating, `Box` and `Vec` may not respect the specified alignment and can cause undefined behavior.

GHSA-wm8x-php5-hvq6 Affected Maligned Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
maligned
crates.io
≤ 0.2.1

References

Frequently Asked Questions

What is GHSA-wm8x-php5-hvq6?
GHSA-wm8x-php5-hvq6 is a security vulnerability in Maligned involving Maligned causes incorrect deallocation under General Security Weakness.
Which Maligned versions are affected?
Affected versions include releases prior to current release patches across affected packages: maligned.
What version fixes GHSA-wm8x-php5-hvq6?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is maligned affected?
Yes, maligned is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-wm8x-php5-hvq6?
GHSA-wm8x-php5-hvq6 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-wm8x-php5-hvq6?
Run the dependency tree command: 'inspect dependencies for maligned'. 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-wm8x-php5-hvq6",
  "modified" : "2023-03-07T20:13:19Z",
  "published" : "2023-03-07T20:13:19Z",
  "aliases" : [ ],
  "summary" : "Maligned causes incorrect deallocation",
  "details" : "`maligned::align_first` manually allocates with an alignment larger than T, and then uses `Vec::from_raw_parts` on that allocation to get a `Vec<T>`.\n\n[`GlobalAlloc::dealloc`](https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc) requires that the `layout` argument must be the same layout that was used to allocate that block of memory.\n\nWhen deallocating, `Box` and `Vec` may not respect the specified alignment and can cause undefined behavior.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "maligned"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tylerhawkes/maligned/issues/5"
  }, {
    "type" : "WEB",
    "url" : "https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tylerhawkes/maligned"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0017.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-07T20:13:19Z",
    "nvd_published_at" : null
  }
}