REDHAT-BUG-2583452: Use After Free
Use After Free vulnerability in Erlang/OTP erts allows an attacker who can create a file system entry with a chosen name to hang or abort the Erlang VM on macOS.
On macOS, the VM decodes file names with doutf8tolistnormalize in erts/emulator/beam/erlunicode.c. When a name starts with a combining mark, such as U+0301, cleanupnorm builds the first list cells but does not return its advanced heap pointer. The caller then releases the heap words that hold those cells, and the returned list refers to released process heap memory that the next allocation overwrites. file:listdir/1, file:listdirall/1, file:deldirr/1 and filelib:wildcard/1 on a directory that contains such a name do not return, and the VM does not stop on SIGTERM. file:readlink/1 on a symbolic link with such a target aborts the VM with sizeobject: bad tag. Only loss of availability was demonstrated.
This issue affects OTP from OTP 17.0 before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to erts from 6.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 to a fixed release to a version that resolves this vulnerability.
Fixed in 27.3.4.20 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 28.5.0.9 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 29.1.3
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
The demonstrated behavior is specific to macOS. Affected Erlang/OTP releases range from OTP 17.0 up to, but not including, OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3.
What does an attacker need to exploit the flaw?
An attacker needs the ability to create a filesystem entry with a chosen name, or create a symbolic link with a chosen target. The problematic name or link target begins with a combining Unicode mark, such as U+0301.
What application operations can trigger the issue?
Directory operations can hang when processing a directory containing the crafted name: file:list_dir/1, file:list_dir_all/1, file:del_dir_r/1, and filelib:wildcard/1. Calling file:read_link/1 on a symbolic link with a crafted target can abort the Erlang VM.
What is the observed impact?
The demonstrated impact is loss of availability. The VM may hang and fail to stop on SIGTERM during affected directory operations, or abort with "size_object: bad tag" when reading an affected symbolic link.
What versions resolve the issue?
Update to OTP 27.3.4.20, OTP 28.5.0.9, or OTP 29.1.3 or later in the respective release lines. These correspond to erts 15.2.7.15, 16.4.0.8, and 17.1.2.