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

CVE-2026-54638: Pre-Authentication Denial of Service via Unbounded Memory Allocation in gotd/td MTProto Parser

Amit Schendel
Amit Schendel
Senior Security Researcher

Jul 29, 2026·7 min read·31 visits

Executive Summary (TL;DR)

A critical pre-authentication vulnerability in gotd/td (< 0.145.1) allows a remote attacker to crash the MTProto server or client with a single 20-byte TCP packet. The parser immediately allocates heap memory based on an unverified length header in unencrypted packets, triggering an out-of-memory crash or severe resource exhaustion prior to any validation.

An unauthenticated remote Denial of Service (DoS) vulnerability exists in the plaintext message parsing implementation of gotd/td, a Go-based Telegram MTProto client and server library. The security flaw is located within the unencrypted message decoding pipeline, where the parser reads an untrusted length header and immediately performs a heap-based memory allocation without checking if the buffer contains the corresponding bytes. An attacker can exploit this behavior by sending a single crafted 20-byte packet containing an extremely large length value, leading to immediate memory exhaustion and process termination by the operating system Out-Of-Memory (OOM) killer.

Vulnerability Overview

The library github.com/gotd/td serves as an open-source Go implementation of the Telegram MTProto protocol, supporting both client-side and server-side operations. A key component of this architecture is the handling of transport-layer handshakes and unencrypted protocol packets. Plaintext messages are typically processed during initial session negotiation and Diffie-Hellman key exchange steps, before cryptographic sessions are fully established and authenticated.

The parsing routing for unencrypted messages is managed by the proto.UnencryptedMessage.Decode method. Because unencrypted handshake packets must be evaluated to establish session states, this decoding endpoint is exposed to any remote, unauthenticated network peer capable of reaching the service port. This exposure creates a direct network attack surface for incoming, untrusted TCP payloads.

The vulnerability is classified as CWE-770 (Allocation of Resources Without Limits or Throttling) and CWE-789 (Memory Allocation with Excessive Size Value). Due to the lack of pre-allocation size verification, an attacker can manipulate the allocation of severe amounts of memory. Successful exploitation disrupts service operations across all established connections, resulting in a complete Denial of Service.

Root Cause Analysis

The root cause of CVE-2026-54638 resides in the logical sequence of operations within proto/unencrypted_message.go. During the decoding of a plaintext message, the parser reads an 8-byte authentication key identifier, an 8-byte message identifier, and a 32-bit signed integer representing the payload data length (dataLen). The data length parameter dictates how many bytes of actual payload content follow the packet headers.

Once dataLen is decoded from the incoming buffer via b.Int32(), the application executes a slice expansion routine using the Go built-in allocator. The code executes make([]byte, dataLen) inside an append wrapper to resize the destination byte slice u.MessageData. In Go, allocating a slice via make requires the runtime to request contiguous virtual memory from the allocator and zero-initialize the memory block, an operation that incurs significant CPU and memory overhead proportional to the requested size.

Crucially, the validation of whether the input buffer actually contains dataLen bytes of unparsed network data is deferred to the subsequent execution of the b.ConsumeN method. If the incoming buffer is shorter than the declared length, ConsumeN correctly identifies the anomaly and returns an unexpected EOF error. However, because this boundary verification occurs after the heap allocation has already executed, the application is forced to perform the resource-intensive memory allocation before validating the packet payload completeness. This architectural sequencing creates an asymmetric resource amplification bug.

Code Analysis

To evaluate the mechanics of the vulnerability, we analyze the vulnerable sequence in proto/unencrypted_message.go side-by-side with the patched implementation. The vulnerable code path executes the allocation before any physical size assertions can check the buffer limits.

// VULNERABLE PATH
func (u *UnencryptedMessage) Decode(b *bin.Buffer) error {
    // ... (reads auth_key_id and message_id)
    
    dataLen, err := b.Int32()
    if err != nil {
        return err
    }
    
    // VULNERABILITY: Allocation occurs prior to buffer completeness checks.
    u.MessageData = append(u.MessageData[:0], make([]byte, dataLen)...) 
    
    // Boundary validation is executed too late to prevent memory allocation.
    if err := b.ConsumeN(u.MessageData, int(dataLen)); err != nil {      
        return errors.Wrap(err, "consume payload")
    }
    return nil
}

In the patched implementation, the maintainers introduced two defensive boundary assertions prior to calling make. The first check ensures that dataLen is non-negative, preventing integer underflow attacks or unexpected behavior with negative values. The second check compares dataLen against the number of unread bytes physically remaining inside the incoming buffer, represented by b.Len().

// PATCHED PATH
func (u *UnencryptedMessage) Decode(b *bin.Buffer) error {
    // ... (reads auth_key_id and message_id)
    
    dataLen, err := b.Int32()
    if err != nil {
        return err
    }
    
    // Validate that the length is not negative
    if dataLen < 0 {
        return &bin.InvalidLengthError{
            Length: int(dataLen),
            Where:  "plaintext message data",
        }
    }
    
    // Validate that the buffer contains at least the declared number of bytes
    if int(dataLen) > b.Len() {
        return errors.Wrap(io.ErrUnexpectedEOF, "consume payload")
    }
    
    // Allocation is now safe to execute
    u.MessageData = append(u.MessageData[:0], make([]byte, dataLen)...)
    if err := b.ConsumeN(u.MessageData, int(dataLen)); err != nil {
        return errors.Wrap(err, "consume payload")
    }
    return nil
}

By comparing dataLen against b.Len(), the library ensures that the memory allocation is strictly bounded by the actual amount of data transmitted by the peer. Since an attacker cannot force the allocation of more memory than the physical payload size they have already sent over the socket, the asymmetric amplification potential is neutralized.

Exploitation Methodology

Exploitation of CVE-2026-54638 requires only a single, malformed TCP packet and no pre-authentication credentials or session state. To execute the attack, the adversary constructs a 20-byte packet containing the MTProto plaintext header structures. The packet layout consists of a 64-bit zeroed auth key ID, a 64-bit arbitrary message ID, and a 32-bit big-endian length parameter.

The attacker sets the final 32-bit length parameter to a massive value such as 0x70000000 (representing approximately 1.75 GB in decimal) and transmits this payload to the target listening TCP port. Because the parser is exposed on the public internet, no transport-layer security or authorization checks intercept this packet prior to the execution of the decoding pipeline.

When the application processes the parsed value, the Go runtime attempts to allocate and zero-initialize a 1.75 GB byte slice on the heap. If the hosting system has a strict virtual memory limit, the operating system kernel instantly sends a SIGKILL to terminate the process via the Out-Of-Memory (OOM) killer. If the allocation succeeds, the runtime is subjected to heavy Garbage Collection (GC) sweeps and memory thrashing, rendering the processor unable to service legitimate connections, which creates a severe service degradation.

Impact Assessment

The overall security impact of this vulnerability is high, exclusively affecting service availability. The vulnerability is highly reproducible and requires low attack complexity, making it an attractive target for automated disruption campaigns. Because the bug lies on the pre-authentication handshake path, no valid credentials or session keys are required to execute the exploit successfully.

In containerized environments (such as Kubernetes or Docker), the container runtime often enforces strict limits on memory consumption. When the OOM killer terminates the process inside a container, the pod or container is forced into a restart loop. Persistent transmission of these crafted packets can keep the target in a continuous crash loop, dropping all established connections and blocking new initialization requests.

For non-containerized environments, the sudden heap allocation pressure can lead to system-wide instability. If multiple threads concurrently handle such malicious handshake requests, the aggregate allocation requests can crash the host server, affecting other co-located applications and infrastructure.

Remediation and Defensive Guidance

The primary remediation step is to update the github.com/gotd/td dependency to version 0.145.1 or later. This update modifies the packet decoding logic, verifying that the payload size specified by the remote peer does not exceed the size of the unread incoming buffer before allocating memory.

If immediate dependency upgrades are not possible, administrators should deploy intermediate mitigation controls at the network layer. Configuring a reverse proxy or application firewall that filters out abnormally large unencrypted packets before they reach the backend Go daemon can intercept exploitation attempts. Additionally, implementing rate-limiting on TCP connection establishment restricts the frequency at which an attacker can execute the exploit.

Workload resource enforcement should also be implemented. Configuring strict limits on virtual memory consumption and establishing automatic process restarting protocols (such as health-check probes in Kubernetes) reduces the recovery window following an OOM event. However, because these mitigations only minimize the recovery time rather than preventing the underlying crash, deploying the library patch remains the only permanent resolution.

Fix Analysis (1)

Technical Appendix

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

Affected Systems

github.com/gotd/td

Affected Versions Detail

Product
Affected Versions
Fixed Version
github.com/gotd/td
gotd
< 0.145.10.145.1
AttributeDetail
CWE IDCWE-770, CWE-789
Attack VectorNetwork
CVSS v3.1 Score7.5 (High)
Exploit MaturityPoC Available
ImpactDenial of Service (OOM Crash)
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-770
Allocation of Resources Without Limits or Throttling

The software allocates memory resources on behalf of an untrusted actor without placing limits on the allocation size or validating that the client is authorized to request such an allocation.

Known Exploits & Detection

GitHubVulnerability disclosure with reproducible Proof of Concept (PoC) code

Vulnerability Timeline

Vulnerability details and PoC submitted by researcher
2026-05-17
Fix commit authored to validate bounds
2026-06-03
Release v0.145.1 containing the fix published
2026-07-28
CVE-2026-54638 assigned and GitHub Advisory published
2026-07-28

References & Sources

  • [1]Official GitHub Advisory
  • [2]Vulnerability Disclosure Issue
  • [3]Fix Commit Link
  • [4]Official v0.145.1 Release Details

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 7 hours ago•CVE-2026-63304
8.1

CVE-2026-63304: OS Command Injection in WWBN AVideo via listFFmpegProcesses

WWBN AVideo versions through 29.0 contain an OS command injection vulnerability (CWE-78) in the standalone API utility function listFFmpegProcesses(). The function constructs a shell pipeline to monitor active FFmpeg processes by interpolating a user-controlled keyword parameter directly into a single-quoted grep argument without sanitization or shell escaping. An attacker capable of crafting or submitting a valid encrypted codeToExec payload can break out of the single-quoted argument context and execute arbitrary operating system commands with the privileges of the web server user.

Alon Barad
Alon Barad
3 views•9 min read
•about 8 hours ago•CVE-2026-59726
10.0

CVE-2026-59726: Unauthenticated Remote Code Execution in Ruflo MCP Bridge

Ruflo versions prior to 3.16.3 expose the Model Context Protocol (MCP) bridge HTTP endpoints (`POST /mcp` and `POST /mcp/:group`) on all network interfaces (`0.0.0.0:3001`) without authentication. Because the primary JSON-RPC tool dispatcher (`executeTool()`) bypasses existing tool blocklists, an unauthenticated network attacker can invoke the `terminal_execute` tool to achieve arbitrary command execution inside the bridge container. This initial access permits full exfiltration of third-party LLM provider API keys, unauthorized access to the co-located MongoDB instance, and manipulation of the AgentDB learning store.

Alon Barad
Alon Barad
10 views•2 min read
•about 9 hours ago•CVE-2026-59818
6.5

CVE-2026-59818: Improper Certificate Revocation List (CRL) Validation on Split gRPC Listeners in etcd

In etcd versions prior to 3.5.32 and 3.6.13, configuring the server with --listen-client-http-urls decouples HTTP and gRPC traffic onto distinct network listeners. Due to an implementation flaw in how TLS configurations are passed to the gRPC server instance, the Certificate Revocation List (CRL) defined by --client-crl-file is enforced exclusively on the HTTP listener and omitted entirely on the dedicated gRPC listener. This allows an adversary possessing a revoked, CA-signed client certificate to bypass mutual TLS (mTLS) revocation checks and authenticate directly to the gRPC interface.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 10 hours ago•CVE-2026-59831
4.4

CVE-2026-59831: Remote Code Execution via Unvalidated URL Scheme Handling in GitHub CLI

GitHub CLI (gh) versions 2.10.0 through 2.95.0 contain an input validation vulnerability in the `gh codespace jupyter` command path. When connecting to a remote Codespace to launch a JupyterLab session, the CLI retrieves a server URL via a remote procedure call (RPC) and passes it directly to the host operating system's default URL dispatcher without validating the scheme or target host. A compromised or malicious Codespace can return a custom protocol URI, such as `vscode://` or `vscode-insiders://`, allowing an attacker to invoke local desktop application handlers and achieve arbitrary command execution on the developer's workstation.

Alon Barad
Alon Barad
11 views•9 min read
•about 11 hours ago•CVE-2026-59191
6.9

CVE-2026-59191: Path Traversal and Arbitrary File Read in CakePHP TwigView FileLoader

A path traversal vulnerability exists in the cakephp/twig-view plugin for the CakePHP framework prior to versions 1.3.3 and 2.1.2. The Cake\TwigView\Twig\FileLoader::findTemplate() method verifies template existence using PHP's native file_exists() function without ensuring the target path resides within configured application or plugin template directories. When user-controlled input is passed to template inclusion mechanisms, an unauthenticated remote attacker can read arbitrary local files accessible to the PHP runtime.

Alon Barad
Alon Barad
6 views•9 min read
•about 12 hours ago•CVE-2026-64855
8.2

CVE-2026-64855: Cryptographic Signature Verification Bypass in soapbar WS-Security Implementation

CVE-2026-64855 (GHSA-859w-52fx-hcm6) is a cryptographic signature verification and authentication bypass vulnerability in the soapbar Python library prior to version 0.13.0. In vulnerable versions, the verify_envelope_bsp() function derives its trust anchor directly from the incoming SOAP message by extracting an untrusted X.509 certificate embedded inside the wsse:BinarySecurityToken header. Because the function checks only the temporal validity of the extracted certificate without performing Certificate Authority (CA) chain validation or certificate pinning, an unauthenticated network attacker can generate a self-signed certificate, sign an arbitrary SOAP payload, and pass verification.

Amit Schendel
Amit Schendel
9 views•10 min read