GHSA-2qv5-7mw5-j3cg: Spin :try_call_once` Can Lead To Undefined Vulnerability
MODERATEGHSA-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
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.
Upgrade spin to 0.9.8
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
GHSA-2qv5-7mw5-j3cg Affected Spin Versions
1 component(s)| 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?
Which Spin versions are affected?
What version fixes GHSA-2qv5-7mw5-j3cg?
Is spin affected?
What CWE is associated with GHSA-2qv5-7mw5-j3cg?
How can I check crates.io dependencies for GHSA-2qv5-7mw5-j3cg?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}