GHSA-9rg7-3j4f-cf4x: Derive com impl QueryInterface Should Call AddRef Before Vulnerability
MODERATEGHSA-9rg7-3j4f-cf4x is a MODERATE queryinterface should call addref before vulnerability (General Security Weakness) affecting Derive com impl libraries in the crates.io ecosystem. The issue involves queryinterface should call addref before returning pointer. Remediation is available by upgrading affected packages to version 0.1.2.
GHSA-9rg7-3j4f-cf4x at a Glance
How to Fix GHSA-9rg7-3j4f-cf4x
To remediate this vulnerability, upgrade all affected Derive com impl 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 derive-com-impl to 0.1.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for derive-com-impl
How to Check if You Are Affected
To determine whether your application is affected by GHSA-9rg7-3j4f-cf4x, inspect your project dependencies for Derive com impl:
inspect dependencies for derive-com-impl
Analyze the terminal output to locate any version of Derive com impl in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.2), 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 Derive com impl, 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-9rg7-3j4f-cf4x Affected Derive com impl Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
derive-com-impl
|
crates.io |
< 0.1.2
|
0.1.2
|
References
Frequently Asked Questions
What is GHSA-9rg7-3j4f-cf4x?
Which Derive com impl versions are affected?
What version fixes GHSA-9rg7-3j4f-cf4x?
Is derive-com-impl affected?
What CWE is associated with GHSA-9rg7-3j4f-cf4x?
How can I check crates.io dependencies for GHSA-9rg7-3j4f-cf4x?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9rg7-3j4f-cf4x",
"modified" : "2022-06-16T23:52:51Z",
"published" : "2022-06-16T23:52:51Z",
"aliases" : [ ],
"summary" : "QueryInterface should call AddRef before returning pointer",
"details" : "Affected version of this crate, which is a required dependency in com-impl, \nprovides a faulty implementation of the `IUnknown::QueryInterface` method.\n\n`QueryInterface` implementation must call `IUnknown::AddRef` before returning the pointer,\nas describe in this documentation:\n<https://docs.microsoft.com/en-us/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(refiid_void)>\n\nAs it is not incrementing the refcount as expected, the following calls to `IUnknown::Release` method \nwill cause WMI to drop reference to the interface, and can lead to invalid reference.\n\nThis is documented in <https://docs.microsoft.com/en-us/windows/win32/learnwin32/managing-the-lifetime-of-an-object#reference-counting>\n\nThere is no simple workaround, as you can't know how many time QueryInterface will be called.\nThe only way to quick fix this is to use the macro expanded version of the code and modify \nthe QueryInterface method to add the AddRef call yourself.\n\nThe issue was corrected in commit `9803f31fbd1717d482d848f041044d061fca6da7`.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "derive-com-impl"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.1.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Connicpu/com-impl/issues/1"
}, {
"type" : "WEB",
"url" : "https://github.com/Connicpu/com-impl/commit/9803f31fbd1717d482d848f041044d061fca6da7"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Connicpu/com-impl"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2021-0083.html"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-16T23:52:51Z",
"nvd_published_at" : null
}
}