# CVE-2021-45681: QueryInterface should call AddRef before returning pointer

- Severity: High 7.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.09%, higher than 66% of CVEs (2026-12-01)
- Published: 2021-01-20T12:00:00.000Z
- Modified: 2026-06-17T04:13:56.253Z
- Also known as: GHSA-9rg7-3j4f-cf4x, GHSA-w4cc-pc2h-whcj, RUSTSEC-2021-0083
- Weaknesses: CWE-787
- Assigned by: mitre

## Description

An issue was discovered in the derive-com-impl crate before 0.1.2 for Rust. An invalid reference (and memory corruption) can occur because AddRef might not be called before returning a pointer.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- derive-com-impl (crates.io): before 0.1.2; all versions; from 0.0.0-0 before 0.1.2
- derive-com-impl_project derive-com-impl: before 0.1.2

## Every score

- GitHub: rating Medium
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:N/I:N/A:P`

## References

- <https://rustsec.org/advisories/RUSTSEC-2021-0083.html> (advisory, third-party-advisory, web)
- <https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/derive-com-impl/RUSTSEC-2021-0083.md> (third-party-advisory, web)
- <https://github.com/Connicpu/com-impl/issues/1> (report, web)
- <https://github.com/Connicpu/com-impl/commit/9803f31fbd1717d482d848f041044d061fca6da7> (web)
- <https://github.com/Connicpu/com-impl> (package)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-45681> (advisory)
- <https://github.com/connicpu/com-impl> (package)
- <https://crates.io/crates/derive-com-impl> (package)

## Sources

- CVE List: [CVE-2021-45681](https://www.cve.org/CVERecord?id=CVE-2021-45681), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-9rg7-3j4f-cf4x](https://github.com/advisories/GHSA-9rg7-3j4f-cf4x), CC-BY-4.0, modified 2023-11-08
- GitHub Advisory Database: [GHSA-w4cc-pc2h-whcj](https://github.com/advisories/GHSA-w4cc-pc2h-whcj), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2021-0083](https://rustsec.org/advisories/RUSTSEC-2021-0083.html), CC0-1.0, modified 2023-11-08
- NVD: [CVE-2021-45681](https://nvd.nist.gov/vuln/detail/CVE-2021-45681), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-45681 · Whole record: https://cve.day/CVE-2021-45681.json · Rebuilt by cve.day 2026-11-25T22:58:06.259Z
