# CVE-2024-8006: NULL pointer dereference in libpcap before 1.10.5 with remote packet capture support

> A NULL pointer dereference in libpcap's remote packet capture feature can cause a denial of service when enabled.

- **Severity:** Medium 4.4 (`CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Aug 2024
- **Updated:** 3 Sep 2024
- **Also known as:** AZL-48409, AZL-48412, AZL-48438, AZL-48462, CLEANSTART-2026-MM14212, DEBIAN-CVE-2024-8006, GHSA-gj9v-677h-mwcx, JLSEC-2026-765, ROOT-OS-ALPINE-320-CVE-2024-8006

## What is CVE-2024-8006?

CVE-2024-8006 is a medium-severity vulnerability in The Tcpdump Group libpcap, published on 30 Aug 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Remote packet capture support is disabled by default in libpcap.  When a user builds libpcap with remote packet capture support enabled, one of the functions that become available is pcap_findalldevs_ex().  One of the function arguments can be a filesystem path, which normally means a directory with input data files.  When the specified path cannot be used as a directory, the function receives NULL from opendir(), but does not check the return value and passes the NULL value to readdir(), which causes a NULL pointer derefence.

Weakness: CWE-476 (NULL Pointer Dereference)

## Which versions are affected by CVE-2024-8006?

It affects 1 product.


Products: Tcpdump Libpcap.

## How do I fix CVE-2024-8006?

Upgrade to a fixed version.

## Is CVE-2024-8006 being exploited?

There is no known exploitation of CVE-2024-8006 in the wild and no public exploit code.

## Other vulnerabilities in The Tcpdump Group libpcap

- [CVE-2011-1935](https://insights.sbomify.com/CVE-2011-1935/): Information disclosure in n/a (critical 9.8)
- [CVE-2019-15163](https://insights.sbomify.com/CVE-2019-15163/): Null dereference in n/a (high 7.5)
- [CVE-2019-15161](https://insights.sbomify.com/CVE-2019-15161/): Integer overflow in n/a (medium 5.3)
- [CVE-2019-15162](https://insights.sbomify.com/CVE-2019-15162/): Information disclosure in n/a (medium 5.3)
- [CVE-2019-15164](https://insights.sbomify.com/CVE-2019-15164/): Server-side request forgery in n/a (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-8006 and fix it if it is affected.

What it is: CVE-2024-8006 is a medium-severity vulnerability in The Tcpdump Group libpcap, published on 30 Aug 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-8006 in the wild and no public exploit code.

Affected product: The Tcpdump Group libpcap. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-8006/ (Markdown: https://insights.sbomify.com/CVE-2024-8006/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-8006
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-8006
- OSV: https://osv.dev/vulnerability/CVE-2024-8006

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-8006/
Summaries are generated and may contain mistakes; the official description above is the record.
