Aug 1, 2026·6 min read·2 visits
Unauthenticated malformed STUN packets can trigger a runtime panic in Pion STUN before 3.1.3, causing a denial of service.
A remote denial of service vulnerability exists in the pion/stun package before version 3.1.3. A malformed STUN packet containing a short or empty XOR-MAPPED-ADDRESS attribute triggers a runtime slice-bounds panic during parsing, terminating the entire Go process.
CVE-2026-54909 is a remote denial of service vulnerability in the Pion STUN package. The vulnerability resides in the parsing of the XOR-MAPPED-ADDRESS attribute inside the library. Pion STUN is a Go-based implementation of the Session Traversal Utilities for NAT (STUN) protocol, which is critical for real-time WebRTC communications. The flaw allows an unauthenticated remote attacker to crash the application by sending a malformed packet over UDP or TCP.
The affected component is commonly deployed in public-facing roles such as STUN/TURN servers, signaling servers, and WebRTC media gateways. Because these components must interact with arbitrary internet clients, they present a high-exposure attack surface. A failure in the core parsing library directly impacts the availability of the dependent real-time communication infrastructure.
The vulnerability belongs to the improper input validation category (CWE-20). It manifests as an unhandled runtime slice-bounds panic when parsing a truncated or empty attribute value. Because the Go runtime terminates the entire process when a panic occurs in an unhandled goroutine, a single malformed packet can disable the service.
The root cause of CVE-2026-54909 is a sequence-of-operations flaw where slice indexing occurs before length validation. Specifically, the method XORMappedAddress.GetFromAs in the file xoraddr.go retrieves the raw byte slice of the target attribute. Before checking whether this slice contains sufficient data, the code attempts to read the first two bytes to determine the address family.
When an incoming STUN attribute has an indicated length of zero or one byte, the returned byte slice is shorter than the required minimum. The code immediately executes value[0:2] to parse the address family integer. Because the slice lacks the minimum required length, the Go runtime triggers a slice bounds out of range panic.
This out-of-order execution logic places the safety check after the potentially panicking operation. The check len(value) <= 4 is present in the vulnerable codebase but resides further down the execution flow. Consequently, any packet containing an empty XOR-MAPPED-ADDRESS attribute bypasses the check by triggering a fatal panic first.
The vulnerable implementation relies on the binary library to read the first two bytes of the attribute payload. The following code excerpt illustrates the out-of-order structure in vulnerable versions prior to 3.1.3:
// Vulnerable implementation
func (a *XORMappedAddress) GetFromAs(msg *Message, attr AttrType) error {
value, err := msg.Get(attr)
if err != nil {
return err
}
// Violation: Slicing value[0:2] before verifying len(value)
family := bin.Uint16(value[0:2])
if family != familyIPv6 && family != familyIPv4 {
return newDecodeErr("xor-mapped address", "family",
fmt.Sprintf("unknown family %d", family),
)
}
// ...
// Late check occurs after the slicing operation above
if len(value) <= 4 {
return io.ErrUnexpectedEOF
}
}The patch moves the length validation to the beginning of the function, immediately after retrieving the attribute value. This structural change ensures that any slice with a length of four bytes or fewer is rejected prior to any index access. The patched implementation handles the error gracefully instead of crashing the runtime:
// Patched implementation in v3.1.3
func (a *XORMappedAddress) GetFromAs(msg *Message, attr AttrType) error {
value, err := msg.Get(attr)
if err != nil {
return err
}
// Correction: Validate length before accessing indexes
if len(value) <= 4 {
return io.ErrUnexpectedEOF
}
// Safe slicing operation
family := bin.Uint16(value[0:2])
if family != familyIPv6 && family != familyIPv4 {
return newDecodeErr("xor-mapped address", "family",
fmt.Sprintf("unknown family %d", family),
)
}
}By returning io.ErrUnexpectedEOF, the library delegates the error handling to the connection loop. The calling routine discards the malformed packet and continues processing subsequent network traffic. This approach eliminates the vulnerability and ensures the application remains online during malformed packet encounters.
An attacker can exploit this vulnerability by sending a single, specifically crafted UDP packet to the listening STUN port. The target service must be running an application built with a vulnerable version of Pion STUN. Since STUN is typically exposed on UDP port 3478, no authentication or prior session state is required to reach the vulnerable code path.
The exploit payload requires a valid STUN header followed by a malformed XOR-MAPPED-ADDRESS attribute. The STUN header specifies a message type, a transaction ID, and a message length of 4 bytes. The subsequent attribute block contains the XOR-MAPPED-ADDRESS attribute identifier but specifies an attribute length of zero bytes.
A representation of the message flow and the resulting runtime exception is shown in the diagram below:
When the parser processes this attribute, the empty byte slice triggers the out-of-bounds error. The process terminates instantly, resulting in a denial of service for all connected clients.
The impact of CVE-2026-54909 is limited to a denial of service (DoS) with a CVSS v3.1 base score of 5.3. The vulnerability does not allow for remote code execution or information disclosure. The attack complexity is low, and no privileges or user interaction are required to execute the attack.
Despite the moderate CVSS score, the operational impact can be significant for environments relying on WebRTC. Real-time media streams, active calls, and signaling sessions are terminated when the host process crashes. Persistent automated attacks can prevent services from maintaining normal operations, leading to prolonged downtime.
Because the vulnerability resides in a core library, downstream products importing pion/stun are also affected. This includes WebRTC gateways, TURN servers, and custom signaling solutions. Security teams must audit their Go dependency graphs to identify transitive usage of the vulnerable package.
The primary remediation strategy is upgrading the github.com/pion/stun dependency to version 3.1.3 or later. This can be accomplished by updating the go.mod file and rebuilding the application. Organizations running downstream packages such as pion/webrtc should update those libraries to versions that import the patched STUN module.
If an immediate upgrade is not feasible, temporary mitigation can be implemented at the network level. Firewalls or intrusion prevention systems can be configured to filter out malformed STUN packets. Specifically, rules can target packets containing an XOR-MAPPED-ADDRESS attribute with an invalid length field.
Developers should also adopt safe coding practices when parsing binary protocols in Go. All slice indexing must be preceded by explicit boundary checks. Implementing automated fuzz testing can help identify similar index-out-of-bounds panics before code is deployed to production.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
stun Pion | < 3.1.3 | 3.1.3 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-20 |
| Attack Vector | Network |
| CVSS v3.1 Score | 5.3 |
| Impact | Denial of Service |
| Exploit Status | poc |
| CISA KEV Status | No |
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
A stored Cross-Site Scripting (XSS) vulnerability exists in the @apostrophecms/seo package of the ApostropheCMS ecosystem up to and including version 1.4.2. Unsanitized user inputs for Google Analytics and Google Tag Manager IDs are injected directly into script elements within the document header, enabling authenticated editors to execute arbitrary JavaScript in the context of all site visitors.
CVE-2026-54908 is a Denial of Service (DoS) vulnerability in the Pion DTLS library, where a malformed ServerKeyExchange message triggers an uncaught out-of-bounds slice read panic during handshake unmarshaling, terminating the hosting application process.
An open redirect vulnerability exists in core-geonetwork from versions 3.12.0 until 4.2.16 and 4.4.11 due to unsafe redirect validation in GeonetworkOAuth2LoginAuthenticationFilter and KeycloakAuthenticationProcessingFilter. An attacker can construct a protocol-relative URL to bypass local redirection checks and redirect authenticated users to malicious external domains.
An observable response discrepancy vulnerability in WPGraphQL versions 2.0.0 through 2.15.0 allows unauthenticated remote attackers to enumerate users and extract public profile metadata. Although the password reset mutation is designed to return a uniform success response to prevent enumeration, a legacy deprecated field resolver bypasses this mechanism by resolving the associated user profile if the target account exists.
Between versions 1.0.0 and 1.3.1, the gemini-bridge Model Context Protocol (MCP) server failed to restrict candidate file paths to the workspace root when processing files in inline mode. This allowed unauthenticated local users, or remote attackers executing prompt-injection payloads against connected AI agents, to traverse the directory tree and read arbitrary system files. The retrieved contents were subsequently forwarded to the external Gemini AI CLI and returned in the round-trip response.
FileBrowser Quantum (a fork of Filebrowser) prior to version 1.4.3-beta is vulnerable to multiple directory traversal flaws in its subtitle handler endpoint (`GET /api/media/subtitles`). This allows authenticated users with standard access to read arbitrary text files on the host system.