REDHAT-BUG-2583451: Medium severity Erlang Erlang/OTP vulnerability
Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in the AArch64 JIT in Erlang OTP erts allows an attacker to crash the BEAM virtual machine via input that reaches a chained integer range guard, such as an oversized numeric character reference parsed by xmerlsaxparser.
In erts/emulator/beam/jit/arm/instrcommon.cpp, BeamModuleAssembler::emitisgelt wraps its generated code in preservecache and marks only TMP1 as clobbered. When the compared value is not a small integer, the generated code calls the shared fragment isgeltshared, which also overwrites ARG1 and other caller-saved registers. The register cache keeps stale entries, so later instructions may use a clobbered register as an Erlang term and the emulator dies with a segmentation fault. A reference such as � takes this path in the ?ischar guard of the SAX parser. Only AArch64 builds that run the JIT are affected. The x86-64 JIT and interpreter builds do not contain the faulty code.
This issue affects OTP from OTP 27.0 before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to erts from 15.0 before 15.2.7.15, 16.4.0.8, and 17.1.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Erlang/OTPto a version that resolves this vulnerability.Fixed in 27.3.4.20 - Upgrade
Upgrade
Erlang/OTPto a version that resolves this vulnerability.Fixed in 28.5.0.9 - Upgrade
Upgrade
Erlang/OTPto a version that resolves this vulnerability.Fixed in 29.1.3
Event History
Frequently Asked Questions
Which deployments are exposed?
Only Erlang/OTP deployments running the JIT on AArch64 are affected. The x86-64 JIT and interpreter builds do not contain the faulty code.
What input is needed to trigger the crash?
An attacker needs input that reaches a chained integer range guard with a value that is not a small integer. One demonstrated path is an oversized numeric character reference, such as �, processed by xmerl_sax_parser.
How can I determine whether an installation is affected?
Check that the system is an AArch64 build using the JIT, then check its OTP or erts version. Affected OTP releases begin at 27.0 and are fixed in OTP 27.3.4.20, 28.5.0.9, and 29.1.3; the corresponding fixed erts versions are 15.2.7.15, 16.4.0.8, and 17.1.2.
What can be done before upgrading?
Use an interpreter build rather than the AArch64 JIT where feasible, since interpreter builds do not contain the faulty code. x86-64 JIT builds are also not affected.