CVE-2026-117642 in OTP
Summary
by MITRE • 11/24/2026
Uncontrolled Recursion vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binary_to_term/1,2 to abort the Erlang VM via a fun term with funs nested in its integer fields. dec_term in erts/emulator/beam/external.c decodes terms iteratively, except for the OldIndex and OldUniq fields of NEW_FUN_EXT and the Arity field of EXPORT_EXT. For these fields it calls itself, and it checks that the result is a small integer only after the call returns. An input that places another fun in such a field, nested to sufficient depth, recurses once per level, exhausts the stack of the scheduler thread and crashes the VM. The input must be large enough to reach that depth.
The abort takes down every process on the node. Supervision, try/catch and the safe option do not prevent it. enif_binary_to_term() and the distribution protocol reach the same decoder, and distribution is assumed to run on trusted networks only.
This issue affects OTP from OTP 17.0 before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to erts from 6.0 before 15.2.7.15, 16.4.0.8, and 17.1.2. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/24/2026
The vulnerability described constitutes a critical uncontrolled recursion flaw within the Erlang Open Telecom Platform external term format decoder, specifically impacting versions of ERTS from 6.0 up to specific patches in OTP 27.x through 29.1. This security issue arises from an implementation error in the decoding logic for binary data converted into Erlang terms via functions such as binary_to_term/1 and /2. The core technical flaw lies in how the decoder handles certain fields within NEW_FUN_EXT and EXPORT_EXT structures, namely OldIndex, OldUniq, and Arity. Unlike other parts of the term format which are processed iteratively to prevent stack exhaustion, these specific fields trigger recursive calls back into the dec_term function without adequate depth limiting mechanisms prior to execution.
When an attacker provides a maliciously crafted input containing nested fun terms within these integer fields, the decoder enters an infinite or excessively deep recursion loop. Each level of nesting results in another call to the decoding routine, which consumes stack space on the scheduler thread responsible for handling that particular process. Because Erlang schedulers operate with limited stack sizes designed for typical application logic rather than arbitrary depth traversal, this recursive descent rapidly exhausts available memory resources. The vulnerability is particularly insidious because the validation check ensuring the result is a small integer occurs only after the recursive call returns, meaning there is no early exit or boundary condition to halt the recursion before it becomes catastrophic.
The operational impact of this flaw is severe and immediate. A successful exploitation leads directly to an abort of the Erlang Virtual Machine process hosting the affected node. This crash results in a complete denial of service for all processes running on that specific node, effectively taking down any application relying on that instance. Standard resilience mechanisms such as supervision trees, try/catch blocks, or even the safe option provided by some APIs are ineffective against this type of failure because they operate at the process level and cannot recover from a hard crash caused by stack overflow in the underlying VM scheduler thread. This means that the entire node becomes unavailable until it is manually restarted, causing significant downtime for distributed systems dependent on that cluster member.
The attack surface includes not only direct calls to enif_binary_to_term but also any interaction with the Erlang distribution protocol. Historically, the distribution protocol has been assumed to operate over trusted networks where inputs are considered safe from malicious manipulation. However, this assumption creates a significant risk in modern cloud-native and microservices architectures where network boundaries may be less rigid or where compromised nodes could inject malformed data into internal communications. The fact that both local API calls and remote distributed messages trigger the same vulnerable decoder path means that an attacker with access to either interface can exploit this weakness.
From a classification perspective, this vulnerability aligns closely with CWE-675, Use of Automatically Generated ID, in terms of insufficient control over resource allocation during recursive operations, though more accurately it maps to CWE-674: Uncontrolled Recursion and CWE-787: Out-of-bounds Write if the stack overflow leads to memory corruption beyond just a crash. In the context of the MITRE ATT&CK framework, this behavior is consistent with techniques used in Denial of Service attacks where an adversary leverages resource exhaustion to disrupt service availability. The specific mechanism of exploiting parser recursion depth is often categorized under input validation failures that lead to system instability rather than arbitrary code execution, although stack-based buffer overflows can sometimes be chained for further exploitation depending on the compiler and runtime environment specifics.
Mitigation strategies must focus primarily on upgrading the Erlang/OTP installation to a patched version where this recursive logic has been corrected. The advisory specifies that versions OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1 contain fixes for this issue. For environments running older versions such as those prior to OTP 17.0 or ERTS before 6.0, the impact is unknown but likely present given the age of the codebase. Organizations should prioritize patching nodes that are exposed to untrusted input sources via binary_to_term calls or distribution protocols. Additionally, implementing strict input validation and size limits on incoming data streams can provide a defense-in-depth layer, although it does not replace the need for updating the runtime itself. Monitoring system logs for sudden node crashes due to stack overflow errors may also help in detecting potential exploitation attempts before they cause widespread outages.