# CVE-2026-63387: Libevent: Off-by-one stack buffer overflow in dnsname_to_labels via crafted DNS server response

> A crafted DNS response triggers a stack buffer overflow in Libevent, allowing attackers to crash the application or potentially execute arbitrary code.

- **Severity:** High 7.0 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Aug 2026
- **Updated:** 25 Aug 2026
- **Also known as:** AZL-96918, AZL-96950, AZL-97530, AZL-97548, BELL-CVE-2026-63387, CLSA-2026-1791302296, DEBIAN-CVE-2026-63387, ECHO-1353-fd70-bd79, GHSA-58rx-7448-jw47, ROOT-OS-DEBIAN-11-CVE-2026-63387, UBUNTU-CVE-2026-63387

## What is CVE-2026-63387?

CVE-2026-63387 is a high-severity memory corruption vulnerability in libevent, published on 20 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Libevent is an event notification library. Prior to 2.1.13 and 2.2.2-alpha, libevent has an off-by-one stack buffer overflow in evdns.c when dnsname_to_labels formats a name-bearing DNS record at the end of the 64 KB stack buffer allocated by evdns_server_request_format_response. The final-label check permits j plus label_len plus one to equal buf_len, after which the terminating null byte is written to buf[buf_len]. A crafted DNS server response containing PTR, CNAME, MX, NS, or SOA data can trigger the one-byte out-of-bounds write and crash or corrupt the process. This issue is fixed in versions 2.1.13 and 2.2.2-alpha.

Weakness: CWE-787 (Out-of-bounds Write), CWE-193 (Off-by-one Error), CWE-121 (Stack-based Buffer Overflow)

## Which versions are affected by CVE-2026-63387?


## How do I fix CVE-2026-63387?

Upgrade to a fixed version.

## Is CVE-2026-63387 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-63387 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-63387 and fix it if it is affected.

What it is: CVE-2026-63387 is a high-severity memory corruption vulnerability in libevent, published on 20 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-63387 exists.

Affected product: libevent. 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-2026-63387/ (Markdown: https://insights.sbomify.com/CVE-2026-63387/index.md)
```

## Sources

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

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