Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. derive-com-impl
  4. ›
  5. GHSA-9rg7-3j4f-cf4x

GHSA-9rg7-3j4f-cf4x: QueryInterface should call AddRef before returning pointer

June 16, 2022

Affected version of this crate, which is a required dependency in com-impl, provides a faulty implementation of the IUnknown::QueryInterface method.

QueryInterface implementation must call IUnknown::AddRef before returning the pointer, as describe in this documentation: https://docs.microsoft.com/en-us/windows/win32/api/unknwn/nf-unknwn-iunknown-queryinterface(refiid_void)

As it is not incrementing the refcount as expected, the following calls to IUnknown::Release method will cause WMI to drop reference to the interface, and can lead to invalid reference.

References

  • github.com/Connicpu/com-impl
  • github.com/Connicpu/com-impl/commit/9803f31fbd1717d482d848f041044d061fca6da7
  • github.com/Connicpu/com-impl/issues/1
  • github.com/advisories/GHSA-9rg7-3j4f-cf4x
  • rustsec.org/advisories/RUSTSEC-2021-0083.html

Code Behaviors & Features

Detect and mitigate GHSA-9rg7-3j4f-cf4x with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.1.2

Fixed versions

  • 0.1.2

Solution

Upgrade to version 0.1.2 or above.

Source file

cargo/derive-com-impl/GHSA-9rg7-3j4f-cf4x.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:02 +0000.