Impact
eldap: referral-URL port parsed from a possibly malicious LDAP server.
Using untrusted input to convert between textual decimal representations and arbitrary-precision integers (bignums) with no bound on the number of digits. binary_to_integer/1,2 and list_to_integer/1,2 accept up to the global system_limit (~1.26 million base-10 digits, ~1.26 MB of text), and the reverse integer_to_binary/1 / integer_to_list/1 have no length limit at all.
The render path (integer_to_binary/1,2, integer_to_list/1,2) runs inside a non-yielding C BIF: it does not bump reductions or trap, so it occupies one dirty scheduler thread for the full conversion, uninterruptibly. Converting a large value is slow.
The parse path (binary_to_integer/1,2, list_to_integer/1,2) is less severe: the big-number case is pure Erlang and so preemptible. A ~1.26 M-digit input still takes hundreds of milliseconds.
The danger is amplified because the attacker does not need to transmit a huge number. A cheap operation manufactures one (1 bsl 50_000_000, a product, a power, binary:decode_unsigned/1 of a 1 MB binary), and then a single stringification renders it.
Affected/Unaffected Versions
A version larger than or equal to one of the listed patched versions is unaffected; otherwise, a version that satisfies an expression listed under affected versions is affected, and if it does not, it is unaffected.
The documentation of the OTP version scheme describes how versions should be compared. Note that versions used prior to OTP 17.0, when the new OTP version scheme was introduced, are never listed since it is not well defined how to compare those versions.
In the case of this vulnerability, versions prior to OTP 17.0 are also affected.
Credits
Thanks to Eric Meadows-Jönsson, Jonatan Männchen, Peter Ullrich, and José Valim for finding and responsibly disclosing this vulnerability to the Erlang/OTP project.
Impact
eldap: referral-URL port parsed from a possibly malicious LDAP server.Using untrusted input to convert between textual decimal representations and arbitrary-precision integers (bignums) with no bound on the number of digits.
binary_to_integer/1,2andlist_to_integer/1,2accept up to the globalsystem_limit(~1.26 million base-10 digits, ~1.26 MB of text), and the reverseinteger_to_binary/1/integer_to_list/1have no length limit at all.The render path (
integer_to_binary/1,2,integer_to_list/1,2) runs inside a non-yielding C BIF: it does not bump reductions or trap, so it occupies one dirty scheduler thread for the full conversion, uninterruptibly. Converting a large value is slow.The parse path (
binary_to_integer/1,2,list_to_integer/1,2) is less severe: the big-number case is pure Erlang and so preemptible. A ~1.26 M-digit input still takes hundreds of milliseconds.The danger is amplified because the attacker does not need to transmit a huge number. A cheap operation manufactures one (
1 bsl 50_000_000, a product, a power,binary:decode_unsigned/1of a 1 MB binary), and then a single stringification renders it.Affected/Unaffected Versions
A version larger than or equal to one of the listed patched versions is unaffected; otherwise, a version that satisfies an expression listed under affected versions is affected, and if it does not, it is unaffected.
The documentation of the OTP version scheme describes how versions should be compared. Note that versions used prior to OTP 17.0, when the new OTP version scheme was introduced, are never listed since it is not well defined how to compare those versions.
In the case of this vulnerability, versions prior to OTP 17.0 are also affected.
Credits
Thanks to Eric Meadows-Jönsson, Jonatan Männchen, Peter Ullrich, and José Valim for finding and responsibly disclosing this vulnerability to the Erlang/OTP project.