Dec 2, 2026·10 min read·1 visit
An algorithmic complexity vulnerability in Pion DTLS allows unauthenticated remote attackers to exhaust CPU resources by presenting X.509 certificates with oversized RSA public key moduli during the DTLS handshake.
Pion DTLS versions from 2.0.0 prior to 3.1.13 and 4.0.0-rc.6 fail to enforce an upper bound on the modulus bit length of peer RSA public keys during handshake signature and certificate chain verification. Because RSA verification performs modular exponentiation whose computational complexity grows superlinearly with modulus size, a remote unauthenticated peer can transmit a synthetic certificate containing an arbitrary multi-thousand-bit RSA modulus and an invalid signature to trigger CPU exhaustion.
Pion DTLS (github.com/pion/dtls) is a widely deployed Go implementation of Datagram Transport Layer Security (DTLS), primarily utilized in WebRTC servers, Selective Forwarding Units (SFUs), and real-time media gateways to secure UDP transport channels. During the DTLS handshake phase, endpoints exchange X.509 certificates and verify cryptographic signatures over handshake transcripts to establish peer authenticity and negotiate session keys.
In versions starting from v2.0.0 up to v3.1.12 (and v4.0.0-rc.1 through v4.0.0-rc.5), the certificate parsing logic in Pion DTLS does not validate the bit length of RSA public key moduli received from remote peers. When a peer presents an X.509 certificate containing an *rsa.PublicKey, the library parses the ASN.1 DER structure and passes the unconstrained modulus directly into Go's cryptographic verification routines.
This omission exposes a resource exhaustion flaw classified under CWE-400 (Uncontrolled Resource Consumption), CWE-770 (Allocation of Resources Without Limits or Throttling), and CWE-1284 (Improper Validation of Specified Quantity in Input). A remote peer can construct a certificate containing an artificially large RSA modulus—such as 65,536 or 131,072 bits—and submit it alongside a dummy signature payload. The receiving endpoint attempts to verify the signature before checking whether the public key parameters fall within reasonable operational bounds.
Because DTLS operates over connectionless UDP and WebRTC media ports are typically exposed directly to untrusted network traffic, an unauthenticated attacker can initiate concurrent handshakes bearing oversized RSA keys. Even if the local DTLS endpoint is configured exclusively with an ECDSA certificate for its own identity, it remains vulnerable whenever it verifies an incoming RSA certificate from a client or remote server.
The root cause of CVE-2026-135391 lies in the disparity between how Go's standard crypto/x509 package parses certificates and how transport protocols must bound cryptographic workloads. When x509.ParseCertificate processes a raw DER-encoded certificate, it extracts the public key modulus $N$ and public exponent $e$ into a math/big.Int structure without enforcing a policy limit on the bit length of $N$. In Go's standard crypto/tls library, the handshake engine explicitly enforces a maximum peer RSA key size (maxPeerRSAKeyBits = 8192) prior to executing signature checks. Pion DTLS lacked an equivalent guard.
RSA signature verification requires computing modular exponentiation of the form:
$$s^e \bmod N$$
where $s$ is the signature integer, $e$ is the public exponent (typically $65537$), and $N$ is the RSA modulus of bit length $n$. In arbitrary-precision arithmetic, the cost of modular multiplication and Montgomery reduction scales superlinearly with respect to $n$. While basic schoolbook multiplication scales at $\mathcal{O}(n^2)$ and Karatsuba multiplication scales at $\mathcal{O}(n^{1.585})$, increasing the modulus size from a standard 2,048 bits to 131,072 bits (a $64\times$ increase in bit length) increases the CPU cycles required for a single verification by roughly three orders of magnitude.
The vulnerability introduces severe computational asymmetry between the attacker and the target. Normally, generating a valid RSA key pair of 131,072 bits would require finding two 65,536-bit prime numbers $p$ and $q$, which is computationally infeasible. However, RSA signature verification only uses the public modulus $N$ and exponent $e$; it does not know or check whether $N$ is actually the product of two primes.
Consequently, an attacker does not need to generate a valid RSA key pair or compute a valid cryptographic signature. The attacker simply bit-shifts an arbitrary odd integer in memory to construct a 131,072-bit composite number $N$, embeds it into an X.509 certificate template, and sends random bytes as the signature. The victim endpoint must complete the entire modular exponentiation operation over the 131,072-bit integer before discovering that the resulting value does not match the expected PKCS#1 v1.5 or RSA-PSS padding hash (errKeySignatureMismatch).
Prior to the patch, crypto.go in pion/dtls invoked x509.ParseCertificate directly inside three distinct handshake verification routines: verifyKeySignature, verifyCertificateVerify, and loadCerts. None of these call sites inspected the public key type or modulus dimensions before passing the parsed *x509.Certificate to rsa.VerifyPKCS1v15, rsa.VerifyPSS, or x509.Certificate.CheckSignatureFrom.
In commit fa6e8d38a3a61044117628bde1ac8c1318f34379 (and 0b615da56cf134adba79d75a817e21008cc7c9a5 for v4), the maintainers introduced a centralized wrapper function parsePeerCertificate and a constant maxPeerRSAKeyBits = 8192, aligning Pion DTLS with Go's standard crypto/tls limits:
// Match crypto/tls's default limit to bound peer-controlled RSA verification work.
const maxPeerRSAKeyBits = 8192
func parsePeerCertificate(raw []byte) (*x509.Certificate, error) {
cert, err := x509.ParseCertificate(raw)
if err != nil {
return nil, err
}
// Check if the extracted public key is an RSA key and validate its modulus bit length
if key, ok := cert.PublicKey.(*rsa.PublicKey); ok && key.N.BitLen() > maxPeerRSAKeyBits {
return nil, errPeerRSAKeyTooLarge
}
return cert, nil
}The patch also defines a dedicated fatal handshake error in errors.go to ensure the DTLS state machine immediately aborts the connection when an oversized key is encountered:
errPeerRSAKeyTooLarge = &FatalError{Err: errors.New("peer RSA key exceeds 8192 bits")}All three certificate loading paths in crypto.go were updated to replace direct x509.ParseCertificate calls with parsePeerCertificate:
@@ -179,7 +194,7 @@ func verifyKeySignature(
if len(rawCertificates) == 0 {
return errLengthMismatch
}
- certificate, err := x509.ParseCertificate(rawCertificates[0])
+ certificate, err := parsePeerCertificate(rawCertificates[0])
if err != nil {
return err
}
@@ -298,7 +313,7 @@ func verifyCertificateVerify(
if len(rawCertificates) == 0 {
return errLengthMismatch
}
- certificate, err := x509.ParseCertificate(rawCertificates[0])
+ certificate, err := parsePeerCertificate(rawCertificates[0])
if err != nil {
return err
}
@@ -366,7 +381,7 @@ func loadCerts(rawCertificates [][]byte) ([]*x509.Certificate, error) {
certs := make([]*x509.Certificate, 0, len(rawCertificates))
for _, rawCert := range rawCertificates {
- cert, err := x509.ParseCertificate(rawCert)
+ cert, err := parsePeerCertificate(rawCert)
if err != nil {
return nil, err
}> [!NOTE]
> By placing the check inside loadCerts in addition to verifyKeySignature and verifyCertificateVerify, the patch ensures that every certificate in a multi-certificate chain (including intermediate CA certificates) is validated before x509.Certificate.Verify performs chain signature verification. This prevents variant attacks where an attacker uses a normal 2048-bit leaf key signed by an oversized 131,072-bit intermediate CA key.
Exploiting CVE-2026-135391 requires network reachability to a UDP port running a Pion DTLS listener, or the ability to trick a Pion DTLS client into initiating a handshake with an attacker-controlled DTLS server. In typical WebRTC architectures, DTLS handshakes occur automatically after Interactive Connectivity Establishment (ICE) connectivity checks succeed over negotiated UDP ports.
An attacker constructs a malicious certificate in fractions of a millisecond by allocating a big.Int, shifting a 1 bit left by the desired bit size (e.g., 131071), and setting the least significant bit to 1 so the modulus is odd. The unit test added in crypto_test.go demonstrates the exact certificate generation methodology:
// Construct an arbitrary odd modulus N of 131,072 bits without prime generation
bits := 131072
modulus := new(big.Int).Lsh(big.NewInt(1), uint(bits-1))
modulus.Add(modulus, big.NewInt(1))
key := &rsa.PublicKey{N: modulus, E: 65537}
// Embed the synthetic public key into a DER-encoded X.509 certificate
template := &x509.Certificate{SerialNumber: big.NewInt(1)}
der, err := x509.CreateCertificate(rand.Reader, template, template, key, issuerPrivateKey)Once the DER payload is generated, the attacker can reuse the same static certificate across thousands of concurrent DTLS handshake sessions. Because a 131,072-bit modulus occupies 16,384 bytes (16 KB), the resulting X.509 Certificate handshake message exceeds standard UDP MTU limits (~1,200 to 1,500 bytes). However, the DTLS protocol natively supports handshake message fragmentation across multiple UDP datagrams, which Pion DTLS reassembles in memory before invoking certificate verification.
Depending on the target's role in the DTLS handshake, the attacker triggers the vulnerable code path in one of two ways:
ClientAuth), the attacker completes the initial ClientHello / HelloVerifyRequest cookie exchange and sends the fragmented Certificate and CertificateVerify messages in Flight 4. The server calls loadCerts and verifyCertificateVerify, executing the expensive RSA verification.Certificate message containing the 131,072-bit RSA public key and a ServerKeyExchange message signed with signature.RSA or signature.RSA_PSS_RSAE_SHA256. The client invokes verifyKeySignature and stalls while computing the modular exponentiation.The primary impact of CVE-2026-135391 is service degradation and Denial of Service (DoS) against the host application running Pion DTLS. When an endpoint processes multiple concurrent handshakes containing 65,536-bit or 131,072-bit RSA keys, the Go runtime's worker goroutines become CPU-bound inside math/big.nat.expNN. This starves the Go scheduler, delaying active media packet forwarding, dropping legitimate DTLS handshakes due to timeout expiration, and causing latency spikes across real-time audio/video streams.
The vulnerability is assigned a CVSS v4.0 base score of 6.9 (Medium) with the vector CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N:
AV:N) & Complexity (AC:L): Exploitable remotely over the network with no specialized preconditions or race conditions.PR:N) & User Interaction (UI:N): Occurs during the unauthenticated handshake phase prior to session establishment.VA:L): Scored as Low in the CVSS v4.0 advisory baseline, though sustained concurrent flood attacks can fully saturate available CPU cores on the target endpoint.VC:N/VI:N): The flaw does not permit memory corruption, private key disclosure, or signature forgery.A critical operational nuance is that configuring a Pion DTLS service with an ECDSA certificate does not mitigate this vulnerability. In TLS and DTLS, the local endpoint's certificate type is independent of the peer's certificate type. As long as RSA signature algorithms (signature.RSA or signature.RSA_PSS_*) or client certificate verification routines remain reachable in the handshake state machine, a peer can force the endpoint down the RSA verification code path.
According to FIRST EPSS telemetry, CVE-2026-135391 holds an EPSS score of 0.00581 (0.58%, 49.18th percentile) and is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. No weaponized exploit tooling in the wild has been reported at the time of analysis.
To remediate CVE-2026-135391, developers and system administrators must upgrade github.com/pion/dtls to a patched release that enforces the 8,192-bit RSA modulus ceiling. The fix is available in v3.1.13 for the v3 release branch and v4.0.0-rc.6 for the v4 branch. Note that the legacy v2 branch (<= v2.2.12) is affected and users on v2 should migrate to v3.1.13 or later.
Update the Go module dependency in affected projects using the Go toolchain:
# For v3 module consumers
go get github.com/pion/dtls/v3@v3.1.13
go mod tidy
# For v4 release candidate consumers
go get github.com/pion/dtls/v4@v4.0.0-rc.6
go mod tidyDownstream applications utilizing github.com/pion/webrtc should verify their go.mod dependency graph (go list -m all | grep pion/dtls) to ensure the resolved pion/dtls version is at least v3.1.13, and recompile all static binaries.
If an immediate software upgrade is not feasible, partial mitigation can be achieved at the configuration and network layers:
ClientAuth: dtls.NoClientCert) so the server ignores unsolicited client certificates. Where configurable, restrict accepted signature algorithms and cipher suites exclusively to ECDSA or Pre-Shared Key (PSK) modes.Certificate flights utilizing ECDSA P-256 or 2048-bit RSA keys rarely exceed 2,048 to 4,096 bytes in total reassembled handshake payload size. Edge firewalls or UDP proxies fronting DTLS listeners can enforce rate limits on fragmented DTLS handshake records (ContentType: 22, HandshakeType: 11) or drop handshakes whose cumulative certificate fragment length exceeds 8 KB.CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Pion DTLS (v2) Pion | >= 2.0.0, <= 2.2.12 | v3.1.13 |
Pion DTLS (v3) Pion | >= 3.0.0, < 3.1.13 | v3.1.13 |
Pion DTLS (v4) Pion | < 4.0.0-rc.6 | v4.0.0-rc.6 |
| Attribute | Detail |
|---|---|
| CVE ID | CVE-2026-135391 (GHSA-jp25-wc3w-p9xp) |
| CWE Classification | CWE-400 / CWE-770 / CWE-1284 |
| CVSS v4.0 Score | 6.9 Medium (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L) |
| Attack Vector | Network (Unauthenticated DTLS UDP Handshake) |
| EPSS Score | 0.58% (49.18th Percentile) |
| Impact | CPU Exhaustion / Denial of Service via BigInt Modular Exponentiation |
| Exploit Status | Proof-of-Concept in Unit Tests |
| Patched Versions | v3.1.13, v4.0.0-rc.6 |
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to consume more resources than intended.
Vapor JWTKit versions 4.0.0 prior to 5.8.0 fail to validate the audience (aud) claim in built-in vendor identity token payload types for Apple, Google, and Microsoft. This improper authentication flaw allows an attacker to obtain a legitimately signed ID token for a third-party client application and replay it against a relying party application using JWTKit, resulting in cross-client authentication bypass and account takeover.
GHSA-QMJC-65WP-7V34 documents a software supply-chain compromise targeting the Python Package Index (PyPI) package magique. Threat actors utilized stolen maintainer credentials to publish unauthorized phantom releases (versions 0.6.8 and 0.6.9) directly to PyPI on June 8, 2026. These distributions contain a malicious .pth path configuration file that automatically triggers an embedded JavaScript payload via the Bun runtime upon Python interpreter startup, resulting in credential theft, process memory scraping, and worm-like self-propagation.
CVE-2026-140231 is a memory exhaustion vulnerability in the node-tar package for Node.js prior to version 8.0.0. Because archive decompression lacks backpressure enforcement and zero-size archive entries queue in memory without upper bounds, an attacker who supplies a crafted compressed archive can force the host application to exhaust available resident memory and terminate via an Out-of-Memory (OOM) condition, bypassing existing decompression ratio checks.
CVE-2026-140230 (GHSA-xm6h-2993-3ch9) is an uncontrolled resource consumption vulnerability in the node-tar npm package (tar) prior to version 8.0.0. The flaw stems from asymmetric path depth validation during archive extraction: while entry.path is validated against a maximum segment depth (maxDepth = 1024), entry.linkpath is omitted from this check. When extracting a symbolic or hard link entry with a deeply nested linkpath defined via a GNU LongLink ('K') extended header, the PathReservations subsystem decomposes the path into every parent directory prefix, triggering quadratic O(N^2) string materialization in the V8 heap. A compressed archive as small as 181 bytes forces the Node.js runtime into an uncatchable fatal Out-Of-Memory (OOM) abort.
CVE-2026-141468 is a client-side script gadget vulnerability in the Bootstrap 6 pre-release Toggler plugin (versions >= 6.0.0-alpha.1, < 6.0.0-alpha.2). The plugin accepts untrusted attribute names via data-bs-attribute and values via data-bs-value, which standard HTML sanitizers such as DOMPurify preserve by default. Upon user click interaction, the Toggler._execute() method dynamically assigns these attributes using setAttribute() while only blocklisting the id attribute, allowing attackers to inject executable inline event handlers (CWE-79, CWE-83) or hijack form submission targets via the formaction attribute.
A path-reservation deadlock vulnerability exists in node-tar versions 7.5.22 through 7.5.24 on POSIX platforms. When an archive contains a hardlink or symbolic link entry whose linkpath is an ancestor or descendant of its own path, the internal PathReservations scheduling queue enters an unsatisfiable state. This causes asynchronous extraction operations to stall indefinitely without resolving or rejecting the extraction Promise, resulting in a persistent denial of service.