Skip to content

DoS via WebSocket frame with oversize 64-bit payload length field (Int trap in WebSocketFrameDecoder)

High
rafaelcepeda published GHSA-qcc5-f287-vgmq Jul 9, 2026

Package

swift swift-nio (Swift)

Affected versions

<= 2.100.0

Patched versions

2.101.0

Description

Summary

WebSocketFrameDecoder used Swift's trapping Int(_:) initializer to convert the 8-byte extended payload length field of a WebSocket frame (RFC 6455 §5.2). Any 64-bit length value with the most-significant bit set (≥ 0x8000_0000_0000_0000) caused a fatal runtime trap and terminated the process. The trap fired before maxFrameSize validation, so no configuration could mitigate it, and ByteToMessageDecoder cannot catch a runtime trap.

Impact

An unauthenticated remote peer can crash any NIOWebSocket-based server (including Vapor and Hummingbird) with a single 11-byte frame sent after a completed WebSocket handshake, dropping all active connections until the process restarts.

Proof of Concept

81 7F 80 00 00 00 00 00 00 00 00

Fix

Fixed in #3603: the decoder now uses Int(exactly:) and throws NIOWebSocketError.invalidFrameLength for out-of-range lengths instead of trapping.

Found & Fixed by @g0w6y

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

CVE ID

CVE-2026-43678

Weaknesses

Integer Overflow or Wraparound

The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number. Learn more on MITRE.

Credits