# CVE-2023-7256: Double-free in libpcap before 1.10.5 with remote packet capture support.

> A double-free vulnerability in libpcap during remote packet capture setup can lead to denial of service or arbitrary code execution.

- **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-48415, AZL-48427, AZL-48451, AZL-48468, CLEANSTART-2026-AS20822, DEBIAN-CVE-2023-7256, GHSA-7m22-9mw3-j4pp, JLSEC-2026-764, ROOT-OS-ALPINE-318-CVE-2023-7256, ROOT-OS-ALPINE-319-CVE-2023-7256, ROOT-OS-ALPINE-320-CVE-2023-7256

## What is CVE-2023-7256?

CVE-2023-7256 is a medium-severity use after free 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

In affected libpcap versions during the setup of a remote packet capture the internal function sock_initaddress() calls getaddrinfo() and possibly freeaddrinfo(), but does not clearly indicate to the caller function whether freeaddrinfo() still remains to be called after the function returns.  This makes it possible in some scenarios that both the function and its caller call freeaddrinfo() for the same allocated memory block.  A similar problem was reported in Apple libpcap, to which Apple assigned CVE-2023-40400.

Weakness: CWE-415 (Double Free)

## Which versions are affected by CVE-2023-7256?

It affects 1 product.


Products: Tcpdump Libpcap.

## How do I fix CVE-2023-7256?

Upgrade to a fixed version.

## Is CVE-2023-7256 being exploited?

There is no known exploitation of CVE-2023-7256 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-2023-7256 and fix it if it is affected.

What it is: CVE-2023-7256 is a medium-severity use after free 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-2023-7256 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-2023-7256/ (Markdown: https://insights.sbomify.com/CVE-2023-7256/index.md)
```

## Sources

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

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