{"affected":[{"ranges":[{"events":[{"introduced":"06d402a75078150963b75518ce271582bbb94897"},{"fixed":"043d119950d8de1975a8a507e424d87cf765fbab"},{"fixed":"62c26d132760569a2ac098ce144de2aed4daa548"},{"fixed":"841017c3c85cba30181e7e344e5b16dc0bc25c3b"}],"repo":"https://github.com/erlang/otp","type":"GIT"}]}],"aliases":["GHSA-x527-4ww5-wwr5","CVE-2026-115747"],"credits":[{"name":"Felix Jankowski / Jankowski Engineering GmbH","type":"FINDER"},{"name":"IlYoung","type":"FINDER"},{"name":"Felix Jankowski / Jankowski Engineering GmbH","type":"REPORTER"},{"name":"IlYoung","type":"REPORTER"},{"name":"Jonatan Männchen / EEF","type":"COORDINATOR"},{"name":"Felix Jankowski / Jankowski Engineering GmbH","type":"REMEDIATION_DEVELOPER"},{"name":"Josué Olmos","type":"REMEDIATION_REVIEWER"}],"database_specific":{"capec_ids":["CAPEC-129"],"cpe_ids":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-119"]},"details":"## Summary\n\nImproper 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 `xmerl_sax_parser`.\n\nIn `erts/emulator/beam/jit/arm/instr_common.cpp`, `BeamModuleAssembler::emit_is_ge_lt` wraps its generated code in `preserve_cache` and marks only `TMP1` as clobbered. When the compared value is not a small integer, the generated code calls the shared fragment `is_ge_lt_shared`, 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 `&#576460752303423488;` takes this path in the `?is_char` 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.\n\nThis 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.\n\n## Details\n\n**1. Code generation.** `BeamModuleAssembler::emit_is_ge_lt` in `erts/emulator/beam/jit/arm/instr_common.cpp` emits the `is_ge_lt` instruction, which the compiler produces for a chained guard of the form `A =< X, X < B`. The AArch64 emitter wraps the whole sequence in `preserve_cache` and declares `TMP1` as the only clobbered register, so the register cache keeps its entries across the instruction.\n\n**2. Generic path.** When the operand is not a small integer, the generated code loads it into `ARG1` and calls the global fragment `BeamGlobalAssembler::emit_is_ge_lt_shared`. The fragment performs a generic term comparison and overwrites `ARG1` and other caller-saved registers.\n\n**3. Stale cache.** The cache still records `ARG1` as holding a copy of a BEAM Y register. A later instruction that needs that Y register reuses `ARG1` instead of reloading it from the stack, and so operates on whatever the fragment left behind.\n\n**4. Crash.** The leftover value is treated as a tagged Erlang term. When it is dereferenced as a boxed term, the emulator reads an invalid address and dies with SIGSEGV. The whole node terminates without a crash dump.\n\n**5. Trigger.** The `?is_char` guard in `lib/xmerl/src/xmerl_sax_parser_base.erlsrc` compares a decoded numeric character reference against several ranges in sequence. A value that does not fit a small integer on a 64-bit runtime, for example `&#576460752303423488;` (2^59), takes the generic path. The expected outcome is a `fatal_error` naming an illegal character.\n\nThe fix removes the `preserve_cache` wrapper so the cache is invalidated after the instruction, matching `emit_is_in_range`. The x86-64 emitter never preserved the cache here.\n\n## Proof of concept\n\n1. Run an AArch64 build of OTP 27 or later with the JIT enabled; `erlang:system_info(emu_flavor)` returns `jit`.\n2. Parse an XML document that contains a numeric character reference too large for a small integer, for example `<a>&#576460752303423488;</a>`, with `xmerl_sax_parser:stream/2` or `xmerl_sax_parser:file/2`. No entity expansion or external resource is needed.\n3. The emulator exits with SIGSEGV (status 139) instead of returning `{fatal_error, _, \"Not a legal character: #576460752303423488\", _, _}`.\n\n## Impact\n\nAn attacker who can get an affected AArch64 node to parse crafted XML, or to run other code that compiles to the same comparison sequence over a non-small integer, terminates the whole BEAM VM, including every unrelated application on it. Supervision cannot contain a native crash. Code execution, information disclosure and data modification have not been demonstrated.\n\n## Workarounds\n\nOn AArch64 hosts, run the emulator without the JIT: start it with `erl -emu_flavor emu` when the interpreter flavor is installed, or build OTP with `--disable-jit`. The interpreter does not execute the affected generated code.\n\n## Configurations\n\nOnly AArch64 (ARM64) runtimes that execute the JIT are affected; `erlang:system_info(emu_flavor)` returns `jit` on such a node. The x86-64 JIT, interpreter builds (`emu` flavor) and 32-bit platforms do not run the affected code. The demonstrated path requires an application to pass attacker-controlled XML to `xmerl_sax_parser`, but other Erlang code that compiles to the same chained range guard over a non-small integer can reach the same defect.","id":"EEF-CVE-2026-115747","modified":"2026-11-24T15:29:07.535324Z","published":"2026-11-24T15:29:06.928Z","references":[{"type":"ADVISORY","url":"https://github.com/erlang/otp/security/advisories/GHSA-x527-4ww5-wwr5"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-115747.html"},{"type":"WEB","url":"https://www.erlang.org/doc/system/versions.html#order-of-versions"},{"type":"WEB","url":"https://github.com/erlang/otp/commit/06d402a75078150963b75518ce271582bbb94897"},{"type":"FIX","url":"https://github.com/erlang/otp/commit/043d119950d8de1975a8a507e424d87cf765fbab"},{"type":"FIX","url":"https://github.com/erlang/otp/commit/62c26d132760569a2ac098ce144de2aed4daa548"},{"type":"FIX","url":"https://github.com/erlang/otp/commit/841017c3c85cba30181e7e344e5b16dc0bc25c3b"}],"related":[],"schema_version":"1.8.0","severity":[{"score":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","source":"CNA","type":"CVSS_V4"}],"summary":"AArch64 JIT register-cache bug allows VM denial of service via XML","upstream":[]}