GHSA-pmcv-mgcf-rvxg: Crypto2 Non-aligned U32 Read Vulnerability

HIGH
Published
Advisory Summary

GHSA-pmcv-mgcf-rvxg is a HIGH non-aligned u32 read vulnerability (General Security Weakness) affecting Crypto2 libraries in the crates.io ecosystem. The issue involves non-aligned u32 read in chacha20 encryption and decryption. Remediation is available in the latest vendor maintenance releases.

GHSA-pmcv-mgcf-rvxg at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-pmcv-mgcf-rvxg
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Crypto2
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-pmcv-mgcf-rvxg

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

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

How to Check if You Are Affected

To determine whether your application is affected by GHSA-pmcv-mgcf-rvxg, inspect your project dependencies for Crypto2:

inspect dependencies for crypto2

Analyze the terminal output to locate any version of Crypto2 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 Crypto2, 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

The implementation does not enforce alignment requirements on input slices while incorrectly assuming 4-byte alignment through an unsafe call to `std::slice::from_raw_parts_mut`, which breaks the contract and introduces undefined behavior. This affects Chacha20 encryption and decryption in crypto2.

GHSA-pmcv-mgcf-rvxg Affected Crypto2 Versions

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

References

Frequently Asked Questions

What is GHSA-pmcv-mgcf-rvxg?
GHSA-pmcv-mgcf-rvxg is a security vulnerability in Crypto2 involving Non-aligned u32 read in Chacha20 encryption and decryption under General Security Weakness.
Which Crypto2 versions are affected?
Affected versions include releases prior to current release patches across affected packages: crypto2.
What version fixes GHSA-pmcv-mgcf-rvxg?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is crypto2 affected?
Yes, crypto2 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-pmcv-mgcf-rvxg?
GHSA-pmcv-mgcf-rvxg is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-pmcv-mgcf-rvxg?
Run the dependency tree command: 'inspect dependencies for crypto2'. 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-pmcv-mgcf-rvxg",
  "modified" : "2022-06-16T23:51:32Z",
  "published" : "2022-06-16T23:51:32Z",
  "aliases" : [ ],
  "summary" : "Non-aligned u32 read in Chacha20 encryption and decryption",
  "details" : "The implementation does not enforce alignment requirements on input slices while incorrectly assuming 4-byte alignment through an unsafe call to `std::slice::from_raw_parts_mut`, which breaks the contract and introduces undefined behavior.\n\nThis affects Chacha20 encryption and decryption in crypto2.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "crypto2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/shadowsocks/crypto2/issues/27"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/shadowsocks/crypto2"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2021-0121.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-16T23:51:32Z",
    "nvd_published_at" : null
  }
}