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-55663

CVE-2026-55663: unauthenticated state cookie forgery in mediasoup SCTP stack

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 26, 2026·8 min read·34 visits

Executive Summary (TL;DR)

Unauthenticated state cookie forgery in mediasoup allows on-path attackers targeting unencrypted PlainTransport/PipeTransport to establish fake SCTP connections and inject unauthorized DataChannel messages.

A cryptographic validation flaw (CWE-345) exists in the built-in SCTP implementation of mediasoup (NPM package < 3.20.6, Rust crate < 0.22.5). Due to missing cryptographic signature verification of State Cookies, an on-path attacker targeting PlainTransport or PipeTransport without DTLS can forge state cookies containing static magic bytes. This allows the attacker to establish arbitrary SCTP associations and inject malicious DataChannel messages.

Vulnerability Overview

Stream Control Transmission Protocol (SCTP) is a core transport protocol used within WebRTC implementations to establish and manage data channels. In mediasoup, an open-source WebRTC SFU (Selective Forwarding Unit), SCTP is integrated into the worker processes to allow client-side and server-side data channel communication. The NPM package and Rust crate implementations of mediasoup expose this protocol through transports like WebRtcTransport, PlainTransport, and PipeTransport.

While WebRtcTransport encapsulates SCTP traffic within an encrypted DTLS layer, PlainTransport and PipeTransport allow raw SCTP packets to run directly over unencrypted IP/UDP networks. This unencrypted transport configuration exposes a direct network attack surface if an attacker occupies an on-path network position. When security mechanisms rely entirely on the integrity of protocol-level handshakes, the lack of cryptographic authentication within those handshakes becomes critical.

CVE-2026-55663 describes an architectural flaw in mediasoup's SCTP implementation where the handshake process fails to authenticate State Cookies. Under RFC 9260 specifications, the state cookie returned by a client in a COOKIE-ECHO chunk must be authenticated using a cryptographically secure message authentication code (MAC). In affected versions of mediasoup, this check was absent, rendering the system vulnerable to connection hijacking and arbitrary data injection.

Root Cause Analysis

To prevent resource exhaustion attacks and connection spoofing, RFC 9260 Section 5.1.3 mandates that SCTP implementations employ state cookies. During a normal four-way handshake, the server receives an INIT chunk, generates a State Cookie containing session variables, and transmits it within an INIT-ACK chunk. The server does not allocate memory for a Transmission Control Block (TCB) at this stage. It remains stateless until the client returns the identical cookie in a COOKIE-ECHO chunk.

The integrity of this stateless model depends on the server's ability to verify that the returned cookie was indeed generated by the server itself. This verification prevents an attacker from forging cookies with arbitrary parameters. RFC 9260 specifies that the server must sign the cookie with a local secret key using a cryptographically secure hash function. If a cookie returns without a valid signature, the handshake must immediately fail to prevent unauthorized connection establishment.

In affected versions of mediasoup (versions 3.20.0 through 3.20.5 for NPM, and 0.22.0 through 0.22.4 for the Rust crate), the validation algorithm within StateCookie.cpp did not implement any cryptographic verification. The validation code only performed structural integrity checks and validated static byte values. Specifically, the function checked if the cookie length was 44 bytes, verified a static 8-byte magic sequence (0x6D73776F726B6572 or "msworker"), and verified a static 16-bit capabilities magic value (0xAD81). Because these magic values were hardcoded into the source code, they did not provide any security boundaries against an attacker.

Code Analysis

The vulnerability is localized to the StateCookie::IsMediasoupStateCookie method in worker/src/RTC/SCTP/association/StateCookie.cpp. The implementation relies purely on static offsets and magic numbers to determine the authenticity of a state cookie. Below is the vulnerable code structure that validates incoming cookies:

bool StateCookie::IsMediasoupStateCookie(const uint8_t* buffer, size_t bufferLength)
{
    MS_TRACE();
 
    if (bufferLength != StateCookie::StateCookieLength) // StateCookieLength is 44 bytes
    {
        return false;
    }
 
    // Verify the static magic value 1 ("msworker")
    if (Utils::Byte::Get8Bytes(buffer, 0) != StateCookie::Magic1)
    {
        return false;
    }
 
    auto* negotiatedCapabilitiesField = reinterpret_cast<NegotiatedCapabilitiesField*>(
      const_cast<uint8_t*>(buffer) + StateCookie::NegotiatedCapabilitiesOffset);
 
    // Verify the static magic value 2 (0xAD81)
    if (ntohs(negotiatedCapabilitiesField->magic2) != StateCookie::Magic2)
    {
        return false;
    }
 
    return true;
}

The patched version replaces this static validation check by introducing a cryptographically signed cookie structure. In the updated implementation, when cookie authentication is required, a unique 32-byte secret is generated for the association. The state cookie structure is expanded to 72 bytes, which includes an 8-byte creation timestamp to prevent replay attacks, followed by a 20-byte HMAC-SHA1 signature computed over the cookie contents using the association secret.

bool StateCookie::VerifyMac(
  const uint8_t* buffer, size_t bufferLength, const uint8_t* macKey, size_t macKeyLength)
{
    MS_TRACE();
 
    if (bufferLength != StateCookie::AuthenticatedStateCookieLength) // 72 bytes
    {
        return false;
    }
 
    // Recalculate HMAC-SHA1 over the first 52 bytes of the cookie
    const uint8_t* expectedMac = Utils::Crypto::GetHmacSha1(
      reinterpret_cast<const char*>(macKey), macKeyLength, buffer, StateCookie::MacOffset);
 
    // Check if calculated MAC matches the MAC appended to the cookie
    return std::memcmp(buffer + StateCookie::MacOffset, expectedMac, StateCookie::MacLength) == 0;
}

In addition to verifying the HMAC, the patched validation code checks the creation timestamp against the current system time. If the elapsed time exceeds 60 seconds (defined by ValidCookieLifeMs), the cookie is rejected as stale. This prevents replay attacks, ensuring that even a sniffed legitimate cookie cannot be reused indefinitely to hijack or establish an association.

Exploitation

Exploitation of CVE-2026-55663 requires an attacker to be in a position to send packets to the target mediasoup UDP port hosting the PlainTransport or PipeTransport. Because these transports transmit SCTP directly over raw UDP without DTLS encapsulation, an on-path attacker can easily inject packets. In systems where these ports are exposed to the public internet, a blind attacker could potentially guess or predict active UDP port numbers and IP addresses.

To conduct the attack, the adversary does not need to complete the full 4-way SCTP handshake. Instead of sending an initial INIT chunk, the attacker constructs a fake COOKIE-ECHO chunk directly. The payload of this chunk contains a forged 44-byte State Cookie. To satisfy the vulnerable validation logic, the attacker writes the static magic sequence 'msworker' into the first 8 bytes and the static magic value 0xAD81 into the negotiated capabilities field offset.

Below is a sequence diagram illustrating the differences between a normal handshake and the forged handshake:

Once the forged COOKIE-ECHO packet is received, the mediasoup server validates the static magic bytes and immediately transitions the association state to CONNECTED. The server then issues a COOKIE-ACK to the attacker. At this point, the attacker has established a valid SCTP association and can transmit SCTP DATA chunks containing arbitrary payloads, effectively injecting unauthorized messages into the mediasoup DataChannel stream as if they were a trusted participant.

Impact Assessment

The security impact of CVE-2026-55663 is classified as Medium, receiving a CVSS v3.1 score of 5.6 (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L). The attack complexity is rated as high because the attacker must have an on-path network position or the capability to accurately predict the UDP ports and active association states of the vulnerable transports. This vulnerability does not impact WebRtcTransport instances since they are encapsulated within DTLS, which enforces end-to-end encryption and cryptographic integrity.

For systems utilizing unencrypted PlainTransport or PipeTransport connections, the consequences are significant. By establishing an unauthorized SCTP association, an attacker can bypass all application-layer authorization checks. This allows the injection of malicious DataChannel messages into active video conferencing sessions. Depending on the application logic, injected messages can manipulate session state, spoof chat messages, or trigger administrative actions within the conference.

In addition to data injection, an attacker can read or intercept SCTP stream traffic if they occupy an active on-path position. This compromises the confidentiality of data channel communication. Furthermore, the ability to arbitrarily establish associations and trigger connection state transitions can be leveraged to disrupt active media streams, leading to localized denial-of-service (DoS) conditions on vulnerable mediasoup worker instances.

Remediation

The primary remediation path is to upgrade mediasoup to the patched versions. For Node.js-based applications, update the NPM dependency to version 3.20.6 or higher. For Rust-based applications, update the crate dependency to version 0.22.5 or higher. These versions introduce the requireAuthenticatedCookie option, which is enabled by default for PlainTransport and PipeTransport to enforce cryptographic validation.

If immediate upgrading is not feasible, several defensive workarounds must be applied to mitigate the risk:

  • Enforce DTLS on Transports: Configure PlainTransport or PipeTransport to utilize DTLS encryption. This ensures that all SCTP packets are encapsulated inside a secure, cryptographically authenticated channel.
  • Network-Level Access Control: Restrict access to the UDP port ranges used by PlainTransport and PipeTransport. Implement strict firewall rules (iptables/security groups) to only permit traffic from trusted IP addresses, such as internal application backend servers.
  • IPsec or VPN Tunneling: If traffic must cross untrusted networks, wrap the raw UDP packets within a secure tunnel, such as IPsec or WireGuard, to prevent on-path injection and sniffing.

To detect potential exploitation attempts in legacy environments, network security teams can deploy Intrusion Detection System (IDS) rules. These rules should monitor for incoming SCTP COOKIE-ECHO packets targeting the media port range that are not preceded by an INIT chunk from the same source IP. Additionally, security teams can perform static analysis of network captures to identify 44-byte state cookies containing the ASCII sequence 'msworker', which is indicative of the unauthenticated handshake format used in the vulnerable version.

Official Patches

versaticaSCTP Cookie Cryptographic Verification Commit

Fix Analysis (1)

Technical Appendix

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

Affected Systems

mediasoup (npm package)mediasoup (Rust crate)

Affected Versions Detail

Product
Affected Versions
Fixed Version
mediasoup (npm package)
versatica
>= 3.20.0, < 3.20.63.20.6
mediasoup (Rust crate)
versatica
>= 0.22.0, < 0.22.50.22.5
AttributeDetail
CWE IDCWE-345
Attack VectorNetwork
CVSS v3.1 Score5.6
ImpactData Injection and Session Hijacking
Exploit StatusProof of Concept
CISA KEV ListedNo

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1565.001Data Manipulation: Transmitted Data Manipulation
Impact
CWE-345
Insufficient Verification of Data Authenticity

The product does not sufficiently verify the authenticity of data, allowing attackers to introduce forged or modified data without detection.

Known Exploits & Detection

GitHub Security AdvisoryVulnerability report with test case reproducing state cookie validation bypass.

Vulnerability Timeline

Pull Request #1829 merged, and NPM version 3.20.6 and Rust crate 0.22.5 released with security fix.
2026-06-15
Public disclosure and CVE-2026-55663 assigned.
2026-08-25

References & Sources

  • [1]GHSA-p7x2-g5cq-fhmq: mediasoup SCTP State Cookie Forgery
  • [2]SCTP Cookie Cryptographic Verification Commit
  • [3]Pull Request #1829: Secure State Cookie Implementation
  • [4]mediasoup v3.20.6 Release Notes

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

•about 1 hour ago•CVE-2026-114132
6.3

CVE-2026-114132: Case-Sensitivity Route Rule Bypass in Nuxt Framework

Nuxt versions prior to 4.6.2 suffer from a route rule bypass vulnerability caused by an architectural mismatch in case-sensitivity handling between the Nitro server runtime and the Vue page router. An unauthenticated remote attacker can bypass server-enforced route directives—such as redirects, security headers, and SSR controls—by altering character casing in HTTP request paths.

Amit Schendel
Amit Schendel
3 views•6 min read
•about 2 hours ago•GHSA-78G4-XQWV-Q3G8
7.5

GHSA-78G4-XQWV-Q3G8: Heap-Based Buffer Overflow in Pillow (libopenjp2)

A heap-based buffer overflow vulnerability in Pillow PyPI binary wheels (versions 11.1.0 to 12.x) allows remote code execution or application crash via crafted JPEG 2000 files processed by the bundled libopenjp2 library.

Alon Barad
Alon Barad
14 views•4 min read
•about 3 hours ago•CVE-2026-109618
9.8

CVE-2026-109618: Remote Code Execution in PHP Core via Out-of-Memory longjmp() Uninitialized Memory Access

CVE-2026-109618 (dubbed PHP2Shell) is a critical vulnerability in the PHP engine core resulting from improper out-of-memory exception handling via longjmp(). When request allocation fails mid-processing, non-local control flow bypasses cleanup procedures, leaving memory structures uninitialized or in a use-after-free state during request shutdown.

Amit Schendel
Amit Schendel
10 views•5 min read
•about 3 hours ago•CVE-2026-109619
9.2

CVE-2026-109619: Remote Code Execution in PHP Core via Stale Global State Memory Corruption (PHP2Shell)

CVE-2026-109619 (PHP2Shell) is a critical Use-After-Free vulnerability in the core PHP engine caused by improper global state cleanup during out-of-memory exception handling across persistent worker requests.

Alon Barad
Alon Barad
13 views•6 min read
•about 3 hours ago•CVE-2026-113721
4.5

CVE-2026-113721: Unsafe Link Resolution in virtualenv File Generation

In Python virtualenv prior to version 21.14.9, activation script generators and configuration writers use Path.exists() before writing files. Because Path.exists() resolves symbolic links, it returns False for dangling symlinks. Consequently, virtualenv skips unlinking pre-planted symbolic links or hard links, writing data directly to target locations outside the intended virtual environment directory.

Amit Schendel
Amit Schendel
4 views•5 min read
•10 days ago•CVE-2026-87697
8.8

CVE-2026-87697: Untrusted Deserialization in .NET PresentationCore Clipboard Handling

A remote code execution vulnerability exists in Microsoft .NET due to untrusted data deserialization within the PresentationCore component. The flaw stems from implicit auto-conversion flags during clipboard data retrieval operations.

Alon Barad
Alon Barad
31 views•5 min read