GHSA-2qv5-7mw5-j3cg: Spin :try_call_once` Can Lead To Undefined Vulnerability

MODERATE
Published
Advisory Summary

GHSA-2qv5-7mw5-j3cg is a MODERATE :try_call_once` can lead to undefined vulnerability (General Security Weakness) affecting Spin libraries in the crates.io ecosystem. The issue involves :try_call_once` can lead to undefined behaviour for other initialisers. Remediation is available by upgrading affected packages to version 0.9.8.

GHSA-2qv5-7mw5-j3cg at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-2qv5-7mw5-j3cg
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Spin
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-2qv5-7mw5-j3cg

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

spin fixed: 0.9.8
Upgrade spin to 0.9.8
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 spin

How to Check if You Are Affected

To determine whether your application is affected by GHSA-2qv5-7mw5-j3cg, inspect your project dependencies for Spin:

inspect dependencies for spin

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

`Once::try_call_once` is unsound if invoked more than once concurrently and any call fails to initialise successfully.

GHSA-2qv5-7mw5-j3cg Affected Spin Versions

1 component(s)
Fixed Versions:
0.9.8
Product / Package Ecosystem Affected Versions Fixed Version
spin
crates.io
≥ 0.9.3
< 0.9.8
0.9.8

References

Frequently Asked Questions

What is GHSA-2qv5-7mw5-j3cg?
GHSA-2qv5-7mw5-j3cg is a security vulnerability in Spin involving :try_call_once` can lead to undefined behaviour for other initialisers under General Security Weakness.
Which Spin versions are affected?
Affected versions include releases prior to 0.9.8 across affected packages: spin.
What version fixes GHSA-2qv5-7mw5-j3cg?
Upgrading to 0.9.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spin affected?
Yes, spin is affected in releases prior to 0.9.8. Upgrade your dependency to 0.9.8 or later.
What CWE is associated with GHSA-2qv5-7mw5-j3cg?
GHSA-2qv5-7mw5-j3cg is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-2qv5-7mw5-j3cg?
Run the dependency tree command: 'inspect dependencies for spin'. 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-2qv5-7mw5-j3cg",
  "modified" : "2023-04-03T22:53:18Z",
  "published" : "2023-04-03T22:53:18Z",
  "aliases" : [ ],
  "summary" : "spin-rs initialisation failure in `Once::try_call_once` can lead to undefined behaviour for other initialisers",
  "details" : "`Once::try_call_once` is unsound if invoked more than once concurrently and any call fails to initialise successfully.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "spin"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.3"
      }, {
        "fixed" : "0.9.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mvdnes/spin-rs/issues/148"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mvdnes/spin-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0031.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-04-03T22:53:18Z",
    "nvd_published_at" : null
  }
}