# CVE-2021-45940: libbpf 0.6.0 and 0.6.1 has a heap-based buffer overflow (4 bytes) in bpfobjectopen (called from bpfobjectopenmem and bpf-object-fuzzer.c).

- Severity: Medium 6.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/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.25%, higher than 70% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2021-12-31T23:57:22.000Z
- Modified: 2026-06-17T04:14:17.330Z
- Also known as: BIT-BPFTOOL-2021-45940
- Weaknesses: CWE-787
- Assigned by: mitre

## Description

libbpf 0.6.0 and 0.6.1 has a heap-based buffer overflow (4 bytes) in __bpf_object__open (called from bpf_object__open_mem and bpf-object-fuzzer.c).

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- libbpf_project libbpf: 0.6.0; 0.6.1
- bpftool (Bitnami): from 0.6.0 up to 0.6.0; from 0.6.1 up to 0.6.1

## Every score

- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:N/A:P`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/google/oss-fuzz-vulns/blob/main/vulns/libbpf/OSV-2021-1562.yaml> (exploit, third-party-advisory, web)
- <https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40868> (exploit, issue-tracking, third-party-advisory, web)

## Sources

- CVE List: [CVE-2021-45940](https://www.cve.org/CVERecord?id=CVE-2021-45940), CVE Terms of Use, modified 2024-08-04
- NVD: [CVE-2021-45940](https://nvd.nist.gov/vuln/detail/CVE-2021-45940), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-BPFTOOL-2021-45940](https://osv.dev/vulnerability/BIT-BPFTOOL-2021-45940), Apache-2.0, modified 2024-07-01

---

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