CVE-2021-45681
Description
The derive-com-impl Rust crate before 0.1.2 fails to call AddRef in QueryInterface, leading to memory corruption and invalid references.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
The derive-com-impl Rust crate before 0.1.2 fails to call AddRef in QueryInterface, leading to memory corruption and invalid references.
Vulnerability
The derive-com-impl crate before version 0.1.2, a required dependency for com-impl, provides a faulty implementation of the IUnknown::QueryInterface method. The implementation does not call IUnknown::AddRef before returning the pointer, violating COM specification [2]. This can lead to invalid references and memory corruption.
Exploitation
An attacker would need to trigger calls to QueryInterface on COM objects that use the affected derive macro. The missing AddRef causes the reference count to be lower than expected. Subsequent calls to IUnknown::Release will drop references prematurely, potentially freeing memory while still in use [2]. No authentication or special privileges are required if the affected code is used in a COM context.
Impact
Successful exploitation can lead to invalid references and memory corruption, which may result in denial of service or potentially arbitrary code execution depending on how the freed memory is reused [2]. The vulnerability affects confidentiality, integrity, and availability.
Mitigation
The issue is fixed in version 0.1.2 of derive-com-impl [2][4]. Users should update to >=0.1.2. The RustSec advisory states there is no simple workaround other than manually modifying the expanded macro code to add the AddRef call [2]. The CVE is not listed in CISA's Known Exploited Vulnerabilities catalog.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
derive-com-implcrates.io | >= 0 | — |
Affected products
2- derive-com-impl/derive-com-impldescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-w4cc-pc2h-whcjghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2021-45681ghsaADVISORY
- github.com/Connicpu/com-impl/issues/1ghsaWEB
- raw.githubusercontent.com/rustsec/advisory-db/main/crates/derive-com-impl/RUSTSEC-2021-0083.mdghsax_refsource_MISCWEB
- rustsec.org/advisories/RUSTSEC-2021-0083.htmlghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.