CVE-2022-23639: Crossbeam utils Crossbeam-utils Unsoundness Of AtomicCell<{i,u}64> Arithmetics Vulnerability

HIGH
Advisory Identifier: GHSA-qc84-gqf4-9926
CVSS 8.1
CWE-362
Published
Advisory Summary

CVE-2022-23639 is a HIGH (CVSS 8.1) crossbeam-utils unsoundness of atomiccell<{i,u}64> arithmetics vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Crossbeam utils libraries in the crates.io ecosystem. The issue involves crossbeam-utils unsoundness of atomiccell<{i,u}64> arithmetics on 32-bit targets that support atomic{i,u}64. Remediation is available by upgrading affected packages to version 0.8.7.

CVE-2022-23639 at a Glance

CVE Identifier CVE-2022-23639
GHSA Identifier GHSA-qc84-gqf4-9926
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Crossbeam utils
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2022-23639

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

crossbeam-utils fixed: 0.8.7
Upgrade crossbeam-utils to 0.8.7
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 crossbeam-utils

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-23639, inspect your project dependencies for Crossbeam utils:

inspect dependencies for crossbeam-utils

Analyze the terminal output to locate any version of Crossbeam utils in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.7), 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 CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In Crossbeam utils, 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

### Impact The affected versions of this crate incorrectly assumed that the alignment of `{i,u}64` was always the same as `Atomic{I,U}64`. However, the alignment of `{i,u}64` on a 32-bit target can be smaller than `Atomic{I,U}64`. This can cause the following problems: - Unaligned memory accesses - Data race Crates using `fetch_*` methods with `AtomicCell<{i,u}64>` are affected by this issue. 32-bit targets without `Atomic{I,U}64` and 64-bit targets are not affected by this issue. 32-bit targets with `Atomic{I,U}64` and `{i,u}64` have the same alignment are also not affected by this issue. The following is a complete list of the builtin targets that may be affected. (last update: nightly-2022-02-11) - armv7-apple-ios (tier 3) - armv7s-apple-ios (tier 3) - i386-apple-ios (tier 3) - i586-unknown-linux-gnu - i586-unknown-linux-musl - i686-apple-darwin (tier 3) - i686-linux-android - i686-unknown-freebsd - i686-unknown-haiku (tier 3) - i686-unknown-linux-gnu - i686-unknown-linux-musl - i686-unknown-netbsd (tier 3) - i686-unknown-openbsd (tier 3) - i686-wrs-vxworks (tier 3) ([script to get list](https://gist.github.com/taiki-e/3c7891e8c5f5e0cbcb44d7396aabfe10)) ### Patches This has been fixed in crossbeam-utils 0.8.7. Affected 0.8.x releases have been yanked. ### References https://github.com/crossbeam-rs/crossbeam/pull/781 ### License This advisory is in the public domain.

CVE-2022-23639 Affected Crossbeam utils Versions

1 component(s)
Fixed Versions:
0.8.7
Product / Package Ecosystem Affected Versions Fixed Version
crossbeam-utils
crates.io
< 0.8.7
0.8.7

References

Frequently Asked Questions

What is CVE-2022-23639?
CVE-2022-23639 is a security vulnerability in Crossbeam utils involving crossbeam-utils Unsoundness of AtomicCell<{i,u}64> arithmetics on 32-bit targets that support Atomic{I,U}64 under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Crossbeam utils versions are affected?
Affected versions include releases prior to 0.8.7 across affected packages: crossbeam-utils.
What version fixes CVE-2022-23639?
Upgrading to 0.8.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is crossbeam-utils affected?
Yes, crossbeam-utils is affected in releases prior to 0.8.7. Upgrade your dependency to 0.8.7 or later.
What is the CVSS score of CVE-2022-23639?
CVE-2022-23639 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-23639?
CVE-2022-23639 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check crates.io dependencies for CVE-2022-23639?
Run the dependency tree command: 'inspect dependencies for crossbeam-utils'. 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-qc84-gqf4-9926",
  "modified" : "2025-02-04T17:30:19Z",
  "published" : "2022-02-16T22:36:21Z",
  "aliases" : [ "CVE-2022-23639" ],
  "summary" : "crossbeam-utils Unsoundness of AtomicCell<{i,u}64> arithmetics on 32-bit targets that support Atomic{I,U}64",
  "details" : "### Impact\n\nThe affected versions of this crate incorrectly assumed that the alignment of `{i,u}64` was always the same as `Atomic{I,U}64`. \n\nHowever, the alignment of `{i,u}64` on a 32-bit target can be smaller than `Atomic{I,U}64`.\n\nThis can cause the following problems:\n\n- Unaligned memory accesses\n- Data race\n\nCrates using `fetch_*` methods with `AtomicCell<{i,u}64>` are affected by this issue.\n\n32-bit targets without `Atomic{I,U}64` and 64-bit targets are not affected by this issue.\n32-bit targets with `Atomic{I,U}64` and `{i,u}64` have the same alignment are also not affected by this issue.\n\nThe following is a complete list of the builtin targets that may be affected. (last update: nightly-2022-02-11)\n\n- armv7-apple-ios (tier 3)\n- armv7s-apple-ios (tier 3)\n- i386-apple-ios (tier 3)\n- i586-unknown-linux-gnu\n- i586-unknown-linux-musl\n- i686-apple-darwin (tier 3)\n- i686-linux-android\n- i686-unknown-freebsd\n- i686-unknown-haiku (tier 3)\n- i686-unknown-linux-gnu\n- i686-unknown-linux-musl\n- i686-unknown-netbsd (tier 3)\n- i686-unknown-openbsd (tier 3)\n- i686-wrs-vxworks (tier 3)\n\n([script to get list](https://gist.github.com/taiki-e/3c7891e8c5f5e0cbcb44d7396aabfe10))\n\n### Patches\n\nThis has been fixed in crossbeam-utils 0.8.7.\n\nAffected 0.8.x releases have been yanked.\n\n### References\n\nhttps://github.com/crossbeam-rs/crossbeam/pull/781 \n\n### License\n\nThis advisory is in the public domain.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "crossbeam-utils"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/crossbeam-rs/crossbeam/security/advisories/GHSA-qc84-gqf4-9926"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-23639"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/crossbeam-rs/crossbeam/pull/781"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/crossbeam-rs/crossbeam"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/crossbeam-rs/crossbeam/releases/tag/crossbeam-utils-0.8.7"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2022-0041.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-02-16T22:36:21Z",
    "nvd_published_at" : "2022-02-15T19:15:00Z"
  }
}