Remote DNS-over-QUIC (DoQ) flow-control assertion failure in libngtcp2
In NLnet Labs Unbound 1.22.0 up to and including 1.25.1, a remote unauthenticated client can trigger a libngtcp2 assertion (if compiled with assertions on) and terminate the entire Unbound process using a single DNS-over-QUIC (DoQ) connection and one normal DNS query. This is caused by an erroneous error value passed to libngtcp2. When 'ngtcp2_conn_writev_stream()' returns 'NGTCP2_ERR_STREAM_DATA_BLOCKED', Unbound continues to call 'ngtcp2_ccerr_set_application_error()' with a '-1' error value. The 'int' literal '-1' is implicitly converted to the function's 'uint64_t error_code' parameter as '0xFFFFFFFFFFFFFFFF'. The follow-on 'ngtcp2_conn_write_connection_close()' serialises that value as a QUIC variable-length integer; because '2^64-1' exceeds the 62-bit varint ceiling, 'ngtcp2_put_uvarintlen()' fails 'assert(n < 4611686018427387904ULL)' and the whole resolver process aborts. A remote, unauthenticated DoQ client can trigger this deterministically with a single QUIC connection by advertising 'initial_max_stream_data_bidi_local = 1' in its transport parameters and sending one DoQ query without ever reading the stream.
Problem Types
| Type | CWE ID | Description |
|---|
| CWE | CWE-195 | CWE-195: Signed to Unsigned Conversion Error |
Type: CWE
Description: CWE-195: Signed to Unsigned Conversion Error
Metrics
| Version | Base score | Base severity | Vector |
|---|
| 3.1 | 5.9 | MEDIUM | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
Version: 3.1
Base score: 5.9
Base severity: MEDIUM
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Timeline
| Event | Date |
|---|
| Issue reported by Qifan Zhang | 2026-05-27 00:00:00 |
| NLnet Labs shares patch with Qifan Zhang | 2026-06-15 00:00:00 |
| Qifan Zhang verifies patch | 2026-06-17 00:00:00 |
| Issue reported by Xuanchao Xie | 2026-07-11 00:00:00 |
| NLnet Labs shares patch with Xuanchao Xie | 2026-07-12 00:00:00 |
| Xuanchao Xie verifies patch | 2026-06-13 00:00:00 |
| Fixes released with version 1.25.2 | 2026-07-22 00:00:00 |
Event: Issue reported by Qifan Zhang
Date: 2026-05-27 00:00:00
Event: NLnet Labs shares patch with Qifan Zhang
Date: 2026-06-15 00:00:00
Event: Qifan Zhang verifies patch
Date: 2026-06-17 00:00:00
Event: Issue reported by Xuanchao Xie
Date: 2026-07-11 00:00:00
Event: NLnet Labs shares patch with Xuanchao Xie
Date: 2026-07-12 00:00:00
Event: Xuanchao Xie verifies patch
Date: 2026-06-13 00:00:00
Event: Fixes released with version 1.25.2
Date: 2026-07-22 00:00:00