CVE-2026-125658: Use after free in erts file name normalization on macOS

Published Nov 24, 2026
·
Updated

Summary

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.

Details

1. Decoder entry

primfile:listdir/1 and primfile:readlink/1 decode each native name with primfile:internalnative2name/1. Its implementation, primfileinternalnative2name1 in erts/emulator/beam/erlunicode.c, calls doutf8tolistnormalize when the file name encoding is ERLFILENAMEUTF8MAC. ertsinitsyscommonmisc selects that encoding only on macOS.

2. Missing heap pointer write-back

doutf8tolistnormalize reserves 2 num heap words with HAlloc, reads the name from its end, and keeps code points that can compose (U+0300 and above) in savepoints. If saved points remain when it reaches the start of the name, it calls cleanupnorm(&hp, savepoints, numpoints, &ret) and then HRelease(p, hpend, hp). cleanupnorm copies hpp to a local hp, builds one cons cell per saved point, and writes back only retp. The caller's hp still points below the new cells, so HRelease returns them to the process heap. handlepotentialnorm has the same structure and does write hpp = hp.

3. Effect

The returned list starts in released heap memory. The next allocation of the process overwrites the cells. erlang:display/1 shows a header word in place of the first code point. When the term is copied, for example in the reply of the file server, sizeobjectx either loops without end on a cyclic term or aborts the VM with sizeobject: bad tag.

Proof of concept

1. On macOS, create a directory with one file whose name starts with U+0301: mkdir d && printf x > "d/$(printf '\314\201b')". 2. Run erl -noshell -eval 'io:format("~w~n", [file:listdir("d")]), halt().'. The command prints nothing and does not return. The VM does not stop on SIGTERM. The expected output is {ok,[[769,98]]}. 3. Run erl -noshell -eval 'erlang:display(primfile:internalnative2name(<<204,129,$b>>)), halt().'. The output starts with [<cp/header:0x00000000000000c0>. The expected output is [769,98]. 4. Create a symbolic link with the same name as its target (ln -s "$(printf '\314\201b')" link) and call file:readlink("link"). The VM aborts with sizeobject: bad tag for 0x80.

Impact

An attacker who can create a file, directory or symbolic link target with a chosen name in a location that an Erlang node on macOS reads can make the VM hang or abort. The hung VM does not stop on SIGTERM.

Workarounds

Start the VM with the +fnl flag, for example through ERLFLAGS. The VM then does not decode or normalize file names. This changes the result of file name functions for names outside ASCII: the VM returns each byte of the name as one Latin-1 character.

Configurations

The node runs on macOS with the default utf8 file name encoding, and reads a directory listing or a symbolic link target that contains a name an attacker chose. Linux and other platforms do not normalize file names and are not affected.

Other sources

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.

— MITRE

Affected Software

1 affected component
Ericsson Erlang/OTP>=17.0<27.3.4.20, >=28.0<28.5.0.9, >=29.0<29.1.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade erlang/otp to a version that resolves this vulnerability.

    Fixed in 27.3.4.20
  2. Upgrade

    Upgrade erlang/otp to a version that resolves this vulnerability.

    Fixed in 28.5.0.9
  3. Upgrade

    Upgrade erlang/otp to a version that resolves this vulnerability.

    Fixed in 29.1.3
  4. Configuration

    Start the VM with the +fnl flag (for example, through ERL_FLAGS) to prevent it from decoding or normalizing file names.

    Erlang/OTP on macOS VM startup flag = +fnl

Event History

Nov 24, 2026
CVE Published
via MITRE·03:28 PM
Data Sourced
via MITRE·03:28 PM
DescriptionWeakness
Data Sourced
via OSV·03:28 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Only Erlang/OTP VMs running on macOS are described as affected. The affected range is OTP 17.0 through versions before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3.

2

What access does an attacker need?

An attacker needs to be able to create a filesystem entry with a chosen name in a directory the VM processes. A filename beginning with a combining mark, such as U+0301, can trigger the issue; a symbolic link whose target has such a name can also trigger an abort during link reading.

3

Which application operations can trigger the failure?

Processing a directory containing the crafted name with file:list_dir/1, file:list_dir_all/1, file:del_dir_r/1, or filelib:wildcard/1 can cause the VM not to return. Calling file:read_link/1 on a symbolic link with the crafted target can abort the VM.

4

How can operators recognize an attempted or successful trigger?

Affected directory operations may hang without returning, and the Erlang VM may not stop when sent SIGTERM. The symbolic-link case can terminate the VM with a "size_object: bad tag" error; only availability impact was demonstrated.

5

What versions contain the fix?

Upgrade to OTP 27.3.4.20, 28.5.0.9, or 29.1.3, as applicable to the release line. These correspond to erts 15.2.7.15, 16.4.0.8, and 17.1.2.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203