Erlang OTP Patch Fixes Heap Overrun in binary_to_term Decoder

A medium-severity out-of-bounds read vulnerability in Erlang OTP’s external term format decoder allows attackers to crash the VM by sending malformed FLOAT_EXT data without a terminating zero byte. The flaw affects versions prior to OTP 27.3.4.20, 28.5.0.9, and 29.1.3, and can be triggered via the binary_to_term function or distribution protocols. Patches are available, and the issue does not allow arbitrary code execution.
Key points
- The vulnerability, CVE-2026-120961, exists in the erts emulator’s external term decoder, specifically in how it handles FLOAT_EXT terms.
- The decoder checks for 31 bytes of data but fails to ensure a terminating NUL byte, causing sys_chars_to_double to scan past the buffer into adjacent memory.
- This out-of-bounds read can lead to a VM fault if the scan reaches an unmapped page, resulting in a denial of service.
- The vulnerability affects Erlang OTP versions from 17.0 up to, but not including, 27.3.4.20, 28.5.0.9, and 29.1.3.
- The [safe] option in binary_to_term/2 does not mitigate this issue, as it only restricts atom creation, not structural validation of binary encodings.
- Attackers can exploit this via the enif_binary_to_term() function or the distribution protocol, which is typically assumed to run on trusted networks.
Background
Recent security patches in other software, such as FFmpeg and Tanium, have addressed similar memory corruption and resource consumption flaws. These incidents highlight a broader trend of vulnerabilities in data processing and network communication layers that can lead to crashes or service degradation. The Erlang OTP issue fits this pattern, affecting a widely used programming language for distributed systems.
Why it matters
Erlang OTP is a critical component for building fault-tolerant, distributed systems, often used in telecommunications and financial services. A vulnerability that can crash the VM, even without allowing code execution, poses a significant risk to availability and reliability. The fact that the [safe] option does not mitigate the issue means that developers cannot rely on existing safeguards when handling untrusted data, necessitating immediate updates and alternative serialization methods for external inputs.
What to watch
Developers should update Erlang OTP to the patched versions (27.3.4.20, 28.5.0.9, or 29.1.3) immediately. Until updates are applied, organizations should avoid using binary_to_term/1,2 on untrusted data and consider using TLS with client certificate verification for distribution protocols. Alternative serialization formats like JSON or Protocol Buffers are recommended for handling untrusted external input to prevent exploitation of this and similar vulnerabilities.
Want the full story? Read the original reporting
Read on CVEs | Zero Wire | Cloudflare Radar