GHSA-r24f-hg58-vfrw: Unsafe libyaml Unsafe-libyaml Unaligned Write Of U64 Vulnerability

MODERATE
Published
Advisory Summary

GHSA-r24f-hg58-vfrw is a MODERATE unsafe-libyaml unaligned write of u64 vulnerability (General Security Weakness) affecting Unsafe libyaml libraries in the crates.io ecosystem. The issue involves unsafe-libyaml unaligned write of u64 on 32-bit and 16-bit platforms. Remediation is available by upgrading affected packages to version 0.2.10.

GHSA-r24f-hg58-vfrw at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-r24f-hg58-vfrw
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Unsafe libyaml
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-r24f-hg58-vfrw

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

unsafe-libyaml fixed: 0.2.10
Upgrade unsafe-libyaml to 0.2.10
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 unsafe-libyaml

How to Check if You Are Affected

To determine whether your application is affected by GHSA-r24f-hg58-vfrw, inspect your project dependencies for Unsafe libyaml:

inspect dependencies for unsafe-libyaml

Analyze the terminal output to locate any version of Unsafe libyaml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.10), 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 Unsafe libyaml, 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 allocate memory using the alignment of `usize` and write data to it of type `u64`, without using `core::ptr::write_unaligned`. In platforms with sub-64bit alignment for `usize` (including wasm32 and x86) these writes are insufficiently aligned some of the time. If using an ordinary optimized standard library, the bug exhibits Undefined Behavior so may or may not behave in any sensible way, depending on optimization settings and hardware and other things. If using a Rust standard library built with debug assertions enabled, the bug manifests deterministically in a crash (non-unwinding panic) saying _"ptr::write requires that the pointer argument is aligned and non-null"_. No 64-bit platform is impacted by the bug. The flaw was corrected by allocating with adequately high alignment on all platforms.

GHSA-r24f-hg58-vfrw Affected Unsafe libyaml Versions

1 component(s)
Fixed Versions:
0.2.10
Product / Package Ecosystem Affected Versions Fixed Version
unsafe-libyaml
crates.io
< 0.2.10
0.2.10

References

Frequently Asked Questions

What is GHSA-r24f-hg58-vfrw?
GHSA-r24f-hg58-vfrw is a security vulnerability in Unsafe libyaml involving unsafe-libyaml unaligned write of u64 on 32-bit and 16-bit platforms under General Security Weakness.
Which Unsafe libyaml versions are affected?
Affected versions include releases prior to 0.2.10 across affected packages: unsafe-libyaml.
What version fixes GHSA-r24f-hg58-vfrw?
Upgrading to 0.2.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is unsafe-libyaml affected?
Yes, unsafe-libyaml is affected in releases prior to 0.2.10. Upgrade your dependency to 0.2.10 or later.
What CWE is associated with GHSA-r24f-hg58-vfrw?
GHSA-r24f-hg58-vfrw is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-r24f-hg58-vfrw?
Run the dependency tree command: 'inspect dependencies for unsafe-libyaml'. 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-r24f-hg58-vfrw",
  "modified" : "2023-12-21T18:14:34Z",
  "published" : "2023-12-21T18:14:34Z",
  "aliases" : [ ],
  "summary" : "unsafe-libyaml unaligned write of u64 on 32-bit and 16-bit platforms",
  "details" : "Affected versions allocate memory using the alignment of `usize` and write data to it of type `u64`, without using `core::ptr::write_unaligned`. In platforms with sub-64bit alignment for `usize` (including wasm32 and x86) these writes are insufficiently aligned some of the time.\n\nIf using an ordinary optimized standard library, the bug exhibits Undefined Behavior so may or may not behave in any sensible way, depending on optimization settings and hardware and other things. If using a Rust standard library built with debug assertions enabled, the bug manifests deterministically in a crash (non-unwinding panic) saying _\"ptr::write requires that the pointer argument is aligned and non-null\"_.\n\nNo 64-bit platform is impacted by the bug.\n\nThe flaw was corrected by allocating with adequately high alignment on all\nplatforms.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "unsafe-libyaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dtolnay/unsafe-libyaml/issues/21"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dtolnay/unsafe-libyaml/commit/7755559145c9cf5573639bfecc557893d4a46b0d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dtolnay/unsafe-libyaml"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0075.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-21T18:14:34Z",
    "nvd_published_at" : null
  }
}