# CVE-2026-40170: ngtcp2 has a qlog transport parameter serialization stack buffer overflow

> A stack buffer overflow in ngtcp2 allows remote attackers to execute code or cause denial of service when qlog is enabled.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/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:** 16 Apr 2026
- **Updated:** 15 Jul 2026
- **Also known as:** ALPINE-CVE-2026-40170, DEBIAN-CVE-2026-40170, ECHO-c041-b4eb-d85f, GHSA-f523-465f-8c8f, RHSA-2026:9113, UBUNTU-CVE-2026-40170, openSUSE-SU-2026:10621-1

## What is CVE-2026-40170?

CVE-2026-40170 is a high-severity memory corruption vulnerability in ngtcp2, published on 16 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

ngtcp2 is a C implementation of the IETF QUIC protocol. In versions prior to 1.22.1, ngtcp2_qlog_parameters_set_transport_params() serializes peer transport parameters into a fixed 1024-byte stack buffer without bounds checking. When qlog is enabled, a remote peer can send sufficiently large transport parameters during the QUIC handshake to cause writes beyond the buffer boundary, resulting in a stack buffer overflow. This affects deployments that enable the qlog callback and process untrusted peer transport parameters. This issue has been fixed in version 1.22.1. If developers are unable to immediately upgrade, they can disable the qlog on client.

Weakness: CWE-120 (Buffer Copy without Checking Size of Input), CWE-121 (Stack-based Buffer Overflow)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ngtcp2` | Red Hat:hummingbird:1 | All versions | 0:1.22.1-1.hum1 |
| `ngtcp2-crypto-gnutls` | Red Hat:hummingbird:1 | All versions | 0:1.22.1-1.hum1 |
| `ngtcp2-crypto-gnutls-devel` | Red Hat:hummingbird:1 | All versions | 0:1.22.1-1.hum1 |
| `ngtcp2-crypto-ossl` | Red Hat:hummingbird:1 | All versions | 0:1.22.1-1.hum1 |
| `ngtcp2-crypto-ossl-devel` | Red Hat:hummingbird:1 | All versions | 0:1.22.1-1.hum1 |
| `ngtcp2-devel` | Red Hat:hummingbird:1 | All versions | 0:1.22.1-1.hum1 |
| `ngtcp2-doc` | Red Hat:hummingbird:1 | All versions | 0:1.22.1-1.hum1 |
| `ngtcp2` | openSUSE:Tumbleweed | All versions | 1.22.1-1.1 |

Products: Tatsuhiro-T Ngtcp2.

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

Upgrade to a fixed version.

## Is CVE-2026-40170 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2026-40170 is a high-severity memory corruption vulnerability in ngtcp2, published on 16 Apr 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-40170 exists.

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

## Sources

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

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