CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-26014

Pion DTLS & The Birthday Paradox: How Random Nonces Broke AES-GCM

Alon Barad
Alon Barad
Software Engineer

Feb 12, 2026·6 min read·105 visits

Executive Summary (TL;DR)

Pion DTLS used random numbers for AES-GCM nonces instead of counters. Due to the Birthday Paradox, this leads to collisions in long sessions. A collision breaks AES-GCM security completely (key recovery + forgery). Fixed in v3.1.0 by using sequence numbers.

A fundamental cryptographic flaw in Pion DTLS (versions prior to v3.1.0) exposes AES-GCM encrypted sessions to the 'Forbidden Attack' (nonce reuse). By relying on random values for the explicit nonce rather than a strict counter, the library falls victim to the Birthday Paradox. In high-volume sessions, this guarantees a nonce collision, allowing attackers to recover the authentication key, forge packets, and potentially decrypt traffic.

The Gopher in the Room

If you are building a WebRTC application in Go, you are almost certainly using Pion. It is the gold standard, the heavy lifter, the 'Gopher in the room' for real-time communication. From cloud gaming to suspicious video chat apps, Pion handles the handshake and the transport.

But here is the thing about DTLS (Datagram Transport Layer Security): it is just TLS over UDP. And UDP means packets get lost, reordered, or duplicated. This makes the cryptographic state machine a nightmare to manage compared to the nice, orderly stream of TCP. Developers often take shortcuts to handle this chaos.

In CVE-2026-26014, the shortcut was randomness. Specifically, how the library generated the 'nonce' (number used once) for AES-GCM encryption. The developers trusted crypto/rand to keep them safe. It is a common mistake: assuming that if a number is random enough and big enough, it will never repeat. Spoiler alert: Probability theory hates your assumptions.

Math is a Harsh Mistress (The Flaw)

Let's talk about AES-GCM. It is an AEAD (Authenticated Encryption with Associated Data) cipher. It requires a unique nonce for every single invocation with the same key. If you reuse a nonce, even once, the security guarantees of GCM collapse faster than a house of cards in a hurricane.

The DTLS 1.2 spec (RFC 5288) defines the GCM nonce as 12 bytes: 4 bytes of fixed 'salt' and 8 bytes of 'explicit' nonce sent with the packet. Pion implemented the explicit part by generating 8 random bytes.

Here is where the Birthday Paradox walks in and slaps you. You might think 64 bits (8 bytes) of randomness is massive. But the probability of a collision scales with the square root of the space size. With $2^{64}$ possibilities, you reach a 50% chance of collision after roughly $2^{32}$ packets (about 4.2 billion).

> [!WARNING] > Wait, 4 billion packets? > That sounds like a lot, but in a high-bandwidth WebRTC video stream running 24/7 (like a security camera or a dedicated media server), hitting this number is not just possible; it is inevitable.

Once a collision occurs, an attacker observing the traffic sees two different packets encrypted with the same Key and Nonce. This is the cryptographic equivalent of dividing by zero.

The Smoking Gun (Code Analysis)

Let's look at the code. This is where the 'random' decision was made. The developers likely chose this because tracking state in a UDP protocol is annoying—you have to handle sliding windows and out-of-order delivery.

The Vulnerable Code (Before v3.1.0):

// Inside the encryption routine
// explicitNonce is the 8-byte field
if _, err := rand.Read(explicitNonce); err != nil {
    return nil, err
}
// ... Encrypt using this random nonce ...

That rand.Read call is the fatal flaw. It is stateless. It does not know what it generated five milliseconds ago.

The Fix (Commit 61762dee8217991882c5eb79856b9e7a73ee349f):

The fix aligns Pion with RFC 9325, which mandates deterministic nonces based on the record sequence number. Since DTLS already tracks sequence numbers to prevent replay attacks, we can just use that.

// The new way: Deterministic Construction
// nonce[4:] is the 8-byte explicit part
 
// We combine the Epoch (2 bytes) and Sequence Number (6 bytes)
// to guarantee uniqueness for the life of the session.
seq64 := (uint64(pkt.Header.Epoch) << 48) | (pkt.Header.SequenceNumber & 0x0000ffffffffffff)
 
binary.BigEndian.PutUint64(nonce[4:], seq64)

This change is beautiful in its simplicity. Epoch increments on re-handshake, and SequenceNumber increments on every packet. It is mathematically impossible to repeat a nonce unless the sequence number wraps around (which takes eons) or the implementation is broken elsewhere.

Joux's Forbidden Dance (Exploitation)

So, how do we weaponize this? We use Joux's Attack (the 'Forbidden Attack'). This is not a theoretical 'maybe we can decrypt one byte' attack. This is a 'we own the session' attack.

The Attack Chain

  1. The Campout: We position ourselves as a Man-in-the-Middle (MITM) or a passive observer recording a high-value, long-duration stream (e.g., a corporate conference bridge).
  2. The Hunt: We parse the DTLS headers, specifically looking at the 8-byte explicit nonce field. We store these in a hash table.
  3. The Collision: Eventually, the Birthday Paradox pays off. We find Packet A and Packet B. Different content, same nonce.
  4. The Math:
    • In GCM, Ciphertext = Plaintext XOR Keystream.
    • Since the Key and Nonce are the same, the Keystream is the same.
    • C1 XOR C2 = P1 XOR P2. We now know the XOR difference of the plaintexts. If the content is predictable (like standard RTP headers), we can recover the Keystream.
  5. The Kill (GHASH Recovery): This is the real danger. GCM uses a polynomial MAC (GHASH) for authentication. With two messages using the same nonce, we can set up a polynomial equation where the only unknown is the authentication key, $H$. Solving this equation gives us $H$.

Once we have $H$, we can forge valid authentication tags for any ciphertext. We can inject malicious video frames, terminate the session, or impersonate the server. We have effectively broken the integrity of the connection.

The Fallout & Cleanup

While the CVSS score is a moderate 5.9 (due to the high attack complexity—monitoring 4 billion packets takes time), the impact is catastrophic for affected sessions. For standard web browsing, this is negligible. for infrastructure-grade WebRTC (telehealth, surveillance, industrial control), it is a ticking time bomb.

Mitigation Strategy

  1. Upgrade Immediately: If you are using github.com/pion/dtls, check your go.mod. If it says anything less than v3.1.0, you are vulnerable. go get github.com/pion/dtls/v3@v3.1.0.
  2. Force Re-keying: If you cannot upgrade immediately, configure your application to force a DTLS re-handshake frequently (e.g., every 1 million packets or every hour). This resets the encryption keys before the probability of a nonce collision becomes statistically significant.
  3. Audit Your Crypto: This serves as a stark reminder: Never implement your own nonce logic. If a protocol spec says 'use a counter', use a counter. If it says 'use random', ask 'why not a counter?'. Randomness is not a security strategy; it is a desperate hope that the universe is big enough to hide your mistakes.

Official Patches

PionPull Request #796 fixing the nonce generation

Fix Analysis (1)

Technical Appendix

CVSS Score
5.9/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected Systems

Pion DTLS (Go implementation)WebRTC Applications using PionStreaming Servers (Go-based)VoIP Services using Pion

Affected Versions Detail

Product
Affected Versions
Fixed Version
Pion DTLS
Pion
>= 1.0.0, < 3.1.03.1.0
AttributeDetail
CWE IDCWE-327
Attack VectorNetwork (Passive/MITM)
CVSS v3.15.9 (Medium)
ImpactKey Recovery & Forgery
Key CipherAES-GCM
Collision Bound~2^32 Packets

MITRE ATT&CK Mapping

T1557Adversary-in-the-Middle
Credential Access
T1040Network Sniffing
Credential Access
CWE-327
Broken Crypto Algorithm

Use of a Broken or Risky Cryptographic Algorithm

Known Exploits & Detection

TheoreticalJoux's Forbidden Attack on AES-GCM (Standard Cryptographic Attack)

Vulnerability Timeline

Fix PR #796 Merged
2026-02-10
Advisory Published
2026-02-11

References & Sources

  • [1]GitHub Advisory
  • [2]RFC 9325: Secure Use of TLS and DTLS

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
6 views•10 min read
•1 day ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
12 views•12 min read
•1 day ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•1 day ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
13 views•10 min read
•1 day ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
14 views•10 min read
•1 day ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
6 views•9 min read