A Signed Length Overflow in Erlang/OTP's inet TCP Driver Overflows the Receive Buffer Into BEAM VM Memory From an Unauthenticated Peer
Erlang OTP
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Erlang OTP |
| No fix yet |
| Erlang OTP |
| No fix yet |
| Erlang OTP |
|
|
Erlang OTP
| Product | Affected | Fixed in |
|---|---|---|
| Erlang OTP |
| No fix yet |
| Erlang OTP |
| No fix yet |
| Erlang OTP |
|
|
An attacker that connects to an open Erlang TCP port that uses the inet driver with {packet,4} mode can use a signed overflow in an incorrect packet length calculation to overflow the receive buffer into the VM allocator area and beyond up to about 2 GB.
This would easily trash the allocated block's allocator metadata footer, and the next block, if any, and most likely cause the BEAM VM to crash. Utilizing this with precision enough to achieve Remote Code Execution would be extremely unfeasible.
This issue affects OTP from OTP 17.0 before OTP 27.3.4.17, OTP 28.5.0.6, and OTP 29.0.6, corresponding to erts from 6.0 before 15.2.7.13, 16.4.0.6, and 17.0.6. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.
From the CVE record · EEF
Erlang OTP's inet driver can miscalculate packet length in {packet,4} mode, causing a receive-buffer overflow. An attacker who connects to an open Erlang TCP port using that mode can likely crash the BEAM VM; remote code execution is described as extremely unfeasible.
Operators running Erlang OTP 17.0 through versions before the applicable fixes in OTP 27.3.4.17, 28.5.0.6, or 29.0.6 should check their deployments; whether versions before 17.0 are affected is unknown.