Stack-based Buffer Overflow Affecting ngtcp2 package, versions <1.22.1-r0


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

EPSS
0.05% (16th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-ALPINE323-NGTCP2-16320892
  • published29 Apr 2026
  • disclosed16 Apr 2026

Introduced: 16 Apr 2026

NewCVE-2026-40170  (opens in a new tab)
CWE-121  (opens in a new tab)

How to fix?

Upgrade Alpine:3.23 ngtcp2 to version 1.22.1-r0 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream ngtcp2 package and not the ngtcp2 package as distributed by Alpine. See How to fix? for Alpine:3.23 relevant fixed versions and status.

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.

CVSS Base Scores

version 3.1