Where
-Infinity
0
Severity
5.7
Use After Free
AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

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.

1 / 2
Source: OSV
First published (updated )
Severity
6.9
AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Out-of-bounds Read vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binarytoterm/1,2 to read memory after the input, and to change one byte there, via a FLOATEXT term without a terminating zero byte. decodedsize in erts/emulator/beam/external.c checks only that the 31 bytes of the FLOATEXT field are present. decterm then passes the field to syscharstodouble, which scans to a NUL byte without a length limit. When the field has no NUL, the scan continues into the bytes after the field, and those bytes change the decoded float. When the radix character is found after the field and strtod does not accept it, syscharstodouble overwrites that byte (a , becomes a .). The VM can fault if the scan reaches an unmapped page.

The safe option does not prevent this. enifbinarytoterm() and the distribution protocol reach the same decoder, and distribution is assumed to run on trusted networks only. The write is limited to the one radix byte. No arbitrary write or code execution was shown.

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. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.

Details

1. Size pass. binarytotermint first calls decodedsize in erts/emulator/beam/external.c. For FLOATEXT (tag 99), decodedsize skips 31 bytes and reserves heap for one float. It does not examine the content of the field.

2. Decode pass. decterm passes the pointer to the field to syscharstodouble and then advances by 31 bytes. The call carries no length. syscharstodouble (in erts/emulator/sys/unix/sysfloat.c and erts/emulator/sys/win32/sysfloat.c) treats the field as a C string.

3. Out-of-bounds read. syscharstodouble checks the float syntax one character at a time and requires a NUL after the last digit. A valid encoder pads the field with NUL bytes. When all 31 bytes are part of a float, the scan and the subsequent strtod call continue into the bytes after the field. When the field is the last term of the input, these are bytes after the input. If they complete a valid float and a NUL follows, the decoded value contains them.

4. One-byte write. syscharstodouble remembers the position of the radix character, which can be . or ,. If strtod stops before the end of the scanned string, the function replaces the radix character with the other one in place and calls strtod again. When the field contains only digits, the radix character is a byte after the field. A , there is changed to ..

5. Fault. The scan has no upper limit. If only digits follow up to the end of the mapped memory, the read faults and the VM aborts.

Proof of concept

1. Build a FLOATEXT field without a NUL byte: tag 99 followed by the 31 bytes 1.0e plus 26 times 0 plus 1. This is the float 10.0. 2. Put the field at the end of an input, for example as the last element of a SMALLTUPLEEXT after the version byte 131. 3. Build a larger binary that holds the input followed by the bytes 7 and NUL. Take the input as a sub-binary with binary:part/3. 4. Call binarytoterm/2 with [safe] on the sub-binary. The last element decodes as 1.0e17 and not 10.0: the decoder read the 7 after the input. 5. For the write, use the 31 digits 1234567890123456789012345678901 as the field and put ,5 and NUL after the input. After the call, the , byte in the parent binary is a ..

Impact

An attacker who can supply bytes to binarytoterm/1,2 or enifbinarytoterm() can make the decoder read bytes after the input, which then change the decoded float, and can change one , byte after the input to .. The VM can abort if the read reaches unmapped memory.

Workarounds

Do not call binarytoterm/1,2 on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data. If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification. Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input. Note: the [safe] option to binarytoterm/2 does NOT protect against this issue. It only restricts atom creation, not structural validation of binary encodings.

1 / 2
Source: OSV
First published (updated )
Severity
2.1
AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N

Summary

Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') vulnerability in Erlang OTP inets (httpc module) allows HTTP Request Splitting.

httpc writes request header names and values to the wire without neutralizing CR, LF or NUL characters. On the default path httprequest:mkkeyvaluestr/2, and with the headersasis option httpcrequest:httpheaders/2, build each header line by plain concatenation of the name, ": ", the value and CRLF. A CR/LF in a name or value ends the header line early. An attacker who controls data that an application puts into a header passed to httpc:request/4,5 can add or override request headers, or append a second request on the same connection.

Applications that pass only constant or validated header names and values are not affected. The request line is not affected, because uristring rejects URLs that contain raw CR/LF.

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 inets from 5.10 before 9.3.2.9, 9.6.2.5, and 9.8.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.

Proof of concept

1. Start a TCP listener that prints the bytes it receives, for example on localhost:4444. 2. Call httpc:request(get, {"http://localhost:4444", [{"a: b\r\nc", "d\r\ne: f"}]}, [], []). 3. The listener receives three header lines (a: b, c: d, e: f) instead of one. 4. Repeat with [{headersasis, true}] as the fourth argument and an explicit host header. The same three lines arrive.

Impact

An attacker who controls data in a request header can add or override headers such as Authorization, Cookie, Host or X-Forwarded-For, which may affect authentication, routing or caching decisions on the target server or on intermediaries. With an empty line, the attacker can send a second, attacker-chosen request to the target server over the connection that the application opened.

Workarounds

Validate request header names and values before you pass them to httpc:request/4,5. Reject or replace any name or value that contains CR (\r), LF (\n) or NUL (\0), and accept only header names made of RFC 9110 token characters. Where the application forwards headers from another source, use a fixed allowlist of header names.

1 / 2
Source: OSV
First published (updated )
Severity
9.1
AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Summary

Improper Verification of Cryptographic Signature vulnerability in Erlang OTP ssl (sslhandshake module) allows an on-path attacker to impersonate any server to a TLS 1.2 or DTLS client.

When a server sends no Certificate message and a ServerKeyExchange without a signature, sslhandshake:decodeserverkey/3 reports the signature algorithm as anon, and sslhandshake:verifysignature/5 returns true for anon without a public key. The client does not require a certificate for a certificate-authenticated key exchange, so the handshake completes for the ecdhersa, ecdheecdsa, dhersa and dhedss key exchanges with a cipher suite the client offered. Certificate path validation, verifyfun and the hostname check do not run, and ssl:connect/3 returns {ok, Socket} with {verify, verifypeer} set. The TLS 1.3 client is not affected.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.14, OTP 28.5.0.9, and OTP 29.0.3, corresponding to ssl from 5.3.4 before 11.2.12.10, 11.6.0.8, and 11.7.3.

Details

1. Signature decoding. sslhandshake:decodeserverkey/3 splits the ServerKeyExchange body into the key exchange parameters and a signature. The internal decserverkeysignature/3 maps an empty remainder, a zero-length signature, and the TLS 1.2 anonymous signature algorithm with an empty signature to the signature algorithm anon. It does this for every key exchange algorithm, not only for the anonymous ones.

2. Signature verification. In the certify state the client calls sslhandshake:verifyserverkey/5 for the non-anonymous key exchanges. No Certificate message arrived, so the stored public key is undefined. sslhandshake:verifysignature/5 has a clause that returns true for the anon signature algorithm with any key, and that clause matches.

3. Handshake completion. The client does not check that it received a certificate before it handles ServerHelloDone. It derives the master secret from the unauthenticated (EC)DH parameters and sends ClientKeyExchange, ChangeCipherSpec and Finished. The attacker holds the (EC)DH private key and completes the handshake. ssl:connect/3 returns {ok, Socket}, and ssl:peercert/1 returns {error, nopeercert} on that socket.

Proof of concept

1. Start a TCP server that answers a TLS 1.2 ClientHello with a ServerHello that selects an offered ECDHERSA suite (for example TLSECDHERSAWITHAES128GCMSHA256), then a ServerKeyExchange with x25519 parameters and no signature, then ServerHelloDone. Send no Certificate message. The UnauthenticatedECDH test of the BoringSSL test runner (BoGo) provides such a server. 2. Connect with ssl:connect/3 and the options {verify, verifypeer}, {cacerts, publickey:cacertsget()}, {servernameindication, "www.example.com"} and {customizehostnamecheck, [{matchfun, publickey:pkixverifyhostnamematchfun(https)}]}. 3. On the server, derive the session keys from its own ECDH key pair and the client's ClientKeyExchange, then send ChangeCipherSpec and Finished. 4. ssl:connect/3 returns {ok, Socket}, and the server decrypts the application data that the client sends. A fixed client aborts with a fatal alert after step 1.

Impact

An on-path attacker can impersonate any server to an affected client, then read and modify all application data on the connection. Certificate path validation, verifyfun and the hostname check do not run.

Workarounds

Restrict TLS client connections to TLS 1.3 by setting versions to ['tlsv1.3'] in the client's ssl options.

If a client must use TLS 1.2, offer only the static RSA key exchange cipher suites. These suites have no ServerKeyExchange message. They provide no forward secrecy, and many servers do not accept them.

erlang RsaOnly = ssl:filterciphersuites( ssl:ciphersuites(all, 'tlsv1.2'), [{keyexchange, fun(rsa) -> true; () -> false end}] ), Opts = [ {verify, verifypeer}, {cacerts, publickey:cacertsget()}, {versions, ['tlsv1.2']}, {ciphers, RsaOnly}, {servernameindication, "www.example.com"}, {customizehostnamecheck, [ {matchfun, publickey:pkixverifyhostnamematchfun(https)} ]} ].

Configurations

The vulnerability affects clients whose connection can use TLS 1.2 or DTLS 1.2. The default ssl:connect options allow TLS 1.2. Clients restricted to TLS 1.3 are not affected. Cipher suites that do not use a ServerKeyExchange message (the rsa, ecdhrsa and ecdhecdsa key exchanges) are not affected. Servers are not affected. Exploitation requires an on-path (adversary-in-the-middle) attacker between the client and the intended server.

1 / 2
Source: OSV
First published (updated )
Severity
8.7
AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Improper Validation of Specified Quantity in Input vulnerability in the BER decoder in Erlang/OTP snmp allows an unauthenticated remote attacker to exhaust CPU via an SNMP message that contains an OBJECT IDENTIFIER with a very long sub-identifier.

snmppdus:decoidelement/3 does not limit the number of base-128 octets in a sub-identifier, and snmppdus:decoidelements/3 does not limit the number of sub-identifiers, so one sub-identifier can span the whole datagram. When the value exceeds the native integer size, each further octet copies a growing bignum, and decoding time grows quadratically with the sub-identifier length. The agent and the manager decode OIDs before they check community strings or SNMPv3 credentials, inside the single network interface process (snmpanetif or snmpmnetif). That process does not read the next datagram until decoding completes.

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 snmp from 4.25.1 before 5.18.2.3, 5.20.2.4, and 5.20.7. Whether OTP before OTP 17.0, corresponding to snmp before 4.25.1, is affected is unknown.

Impact

An unauthenticated remote attacker who can send UDP datagrams to an SNMP agent or manager can keep its network interface process busy with a low rate of crafted messages. The agent or manager then stops processing legitimate SNMP traffic while the attack continues.

Workarounds

Restrict network access to the SNMP agent and manager UDP ports to trusted management hosts only, using firewall rules or by binding the agent to a dedicated management interface. Disable SNMPv1 and SNMPv2c in the agent if they are not needed. This reduces, but does not eliminate, the exposure, since SNMPv3 discovery messages are still decoded before authentication.

Note that community strings and SNMPv3 credentials do not mitigate this issue, since decoding happens before they are checked.

1 / 2
Source: OSV
First published (updated )
Severity
7
AV:L/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Out-of-bounds Write vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binarytoterm/1,2 to abort the Erlang VM via a NEWERREFERENCEEXT term with a zero-length ID. decodedsize in erts/emulator/beam/external.c accepts a reference whose 16-bit Len field is zero, but decterm always reads one ID word. decterm then runs 4 bytes ahead of the position that decodedsize validated. It decodes the bytes that follow as terms that were never sized, and writes past the reserved process heap.

The abort takes down every process on the node. Supervision, try/catch and the safe option do not prevent it. enifbinarytoterm() and the distribution protocol reach the same decoder, and distribution is assumed to run on trusted networks only. NEWREFERENCEEXT also accepts a zero length, but its range check on the first ID word rejects the shifted input. On 32-bit builds, a zero-length reference of either type at the end of the input, followed by trailing bytes, can write one word past the reserved heap.

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. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.

Details

1. Size pass. binarytotermint first calls decodedsize to reserve the process heap. For NEWERREFERENCEEXT, decodedsize rejects an ID-word count above ERTSMAXREFNUMBERS but not a count of zero. With Len 0 it skips the tag, the length, the node atom and the 4-byte creation, and no ID bytes.

2. Decode pass. decterm reads Len, the node atom and the creation, then reads the first ID word r0 without checking Len. From here decterm is 4 bytes ahead of the position decodedsize validated.

3. Heap overrun. In the reported input, the reference is followed by a BINARYEXT. decodedsize treats the binary payload as opaque bytes. The shifted decterm consumes the binary tag and the top three length bytes as r0, reads the low length byte (105, LARGETUPLEEXT) as the next tag, and builds a tuple from the payload. The tuple-build loop stores past the heap that was reserved for a reference and a binary.

4. Abort. After decterm returns, binarytotermint compares the heap pointer with the reserved end and calls ertsexit with heap overrun. That check runs after the out-of-bounds stores. Larger inputs can fault with SIGSEGV first.

NEWREFERENCEEXT. Tag 114 also accepts Len 0, but decterm rejects r0 >= MAXREFERENCE for that tag. A shifted r0 begins with a term tag byte, so the input fails with badarg.

Proof of concept

1. Build a NEWERREFERENCEEXT (tag 90) with Len 0, the node atom nonode@nohost as SMALLATOMUTF8EXT, and a 4-byte creation for another node, for example 1. 2. Build a BINARYEXT (tag 109) whose payload starts with a 32-bit arity N, followed by N SMALLINTEGEREXT elements. Pad the payload so that the low byte of the 32-bit binary length is 105 (LARGETUPLEEXT). 3. Wrap both in a two-element SMALLTUPLEEXT after the version byte 131. With N = 40 the input is 391 bytes. 4. Call binarytoterm/1, or binarytoterm/2 with [safe], on the input. The VM aborts with heap overrun by 33 words(s) instead of raising badarg.

Impact

An attacker who can supply bytes to binarytoterm/1,2 or enifbinarytoterm() can abort the Erlang VM and stop every application on the node.

Workarounds

Do not call binarytoterm/1,2 on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data. If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification. Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input. Note: the [safe] option to binarytoterm/2 does NOT protect against this crash. It only restricts atom creation, not structural validation of binary encodings.

1 / 2
Source: OSV
First published (updated )
Severity
6.9
AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Uncontrolled Recursion vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binarytoterm/1,2 to abort the Erlang VM via a fun term with funs nested in its integer fields. decterm in erts/emulator/beam/external.c decodes terms iteratively, except for the OldIndex and OldUniq fields of NEWFUNEXT and the Arity field of EXPORTEXT. For these fields it calls itself, and it checks that the result is a small integer only after the call returns. An input that places another fun in such a field, nested to sufficient depth, recurses once per level, exhausts the stack of the scheduler thread and crashes the VM. The input must be large enough to reach that depth.

The abort takes down every process on the node. Supervision, try/catch and the safe option do not prevent it. enifbinarytoterm() and the distribution protocol reach the same decoder, and distribution is assumed to run on trusted networks only.

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. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.

Details

1. Iterative decoder. decterm in erts/emulator/beam/external.c walks the external term format with an explicit work list, so nested tuples, lists and maps do not grow the C stack. decodedsize runs first and sizes the input the same way.

2. Recursive integer fields. Two tags break that pattern. For NEWFUNEXT (112), decterm reads the OldIndex and OldUniq fields by calling itself and checks issmall on the result afterwards. For EXPORTEXT (113), it reads the Arity field the same way. On current release lines the discarded creator pid of NEWFUNEXT is also read by a recursive call. The recursive call accepts any term, so a fun placed in one of these fields is decoded as a fun, and its own integer fields recurse again.

3. Stack exhaustion. Each nesting level costs one decterm frame on the scheduler thread's stack. decodedsize accepts the input because it only counts terms and heap words. An input nested deeply enough overflows the stack before any issmall check fails, and the VM aborts. The depth needed depends on the stack size of the thread, so the input must be correspondingly large.

4. Fix. The fix decodes these fields with a dedicated decint32 that accepts only SMALLINTEGEREXT and INTEGEREXT, and decodes the creator pid through decpid, leaving no recursive call to decterm.

Proof of concept

1. Build a NEWFUNEXT (tag 112) term with a valid module atom and zero free variables. 2. In place of the OldIndex field, which must be a small integer, encode another NEWFUNEXT term. Repeat this nesting until the chain is deep enough to exhaust the stack of a scheduler thread. The OldUniq field, or the Arity field of an EXPORTEXT (tag 113), can carry the nested fun instead. 3. Prefix the result with the version byte 131 and call binarytoterm/1, or binarytoterm/2 with [safe], on it. 4. The VM aborts from stack exhaustion instead of raising badarg.

Impact

An attacker who can supply bytes to binarytoterm/1,2 or enifbinarytoterm() can abort the Erlang VM and stop every application on the node.

Workarounds

Do not call binarytoterm/1,2 on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data. If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification. Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input. Note: the [safe] option to binarytoterm/2 does NOT protect against this crash. It only restricts atom creation, not structural validation of binary encodings.

1 / 2
Source: OSV
First published (updated )
Severity
8.2
AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Allocation of Resources Without Limits or Throttling vulnerability in Erlang OTP inets (httpdscriptenv module) allows an unauthenticated remote attacker to exhaust the atom table of an httpd server that serves ESI scripts.

When modesi builds the environment for an ESI callback, httpdscriptenv:httpenvelement/3 checks that a request header name already exists as an atom, then creates the atom http<header-name> with listtoatom/1. Atoms are never garbage collected, and each new atom passes the existence check on a later request. So a header named node creates httpnode, a header named httpnode creates httphttpnode, and so on. A stream of requests to any ESI URL grows the atom table until it reaches its limit (+t), and then the whole Erlang VM aborts, together with every application on the node.

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 inets from 5.10 before 9.3.2.9, 9.6.2.5, and 9.8.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.

Proof of concept

1. Start httpd with {erlscriptalias, {"/esi", [Mod]}}, where Mod exports any ESI callback fun/3. 2. Send GET /esi/Mod:fun with a request header named node. The node now holds the atom httpnode. 3. Send the same request with a header named httpnode. The node now holds httphttpnode. 4. Repeat with each new name. Each request adds an atom that persists, until the atom table limit aborts the VM.

Impact

An unauthenticated remote client can permanently grow the atom table of the node with ordinary HTTP requests. When the table reaches its limit, the Erlang VM aborts and takes down every application on the node, not only httpd.

Workarounds

If you do not need ESI, remove erlscriptalias from the httpd configuration. Restrict the ESI URL prefixes to trusted clients, for example with modauth directory protection. Authenticated clients can still trigger the issue. Put httpd behind a reverse proxy that forwards only an allowlist of standard request headers to the ESI URL prefixes. For nginx, set proxypassrequestheaders off and add one proxysetheader for each allowed header.

Configurations

Only httpd servers with at least one erlscriptalias configured are affected, and only for clients that can reach an ESI URL prefix. Where modauth or modsecurity directory protection sits in front of modesi, only authenticated clients can trigger the issue. CGI scripts served by modcgi and the httpc client are not affected.

1 / 2
Source: OSV
First published (updated )
Severity
6.9
AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Uncontrolled Recursion vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binarytoterm/1,2 to abort the Erlang VM via a fun term with funs nested in its integer fields. decterm in erts/emulator/beam/external.c decodes terms iteratively, except for the OldIndex and OldUniq fields of NEWFUNEXT and the Arity field of EXPORTEXT. For these fields it calls itself, and it checks that the result is a small integer only after the call returns. An input that places another fun in such a field, nested to sufficient depth, recurses once per level, exhausts the stack of the scheduler thread and crashes the VM. The input must be large enough to reach that depth.

The abort takes down every process on the node. Supervision, try/catch and the safe option do not prevent it. enifbinarytoterm() and the distribution protocol reach the same decoder, and distribution is assumed to run on trusted networks only.

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. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.

Details

1. Iterative decoder. decterm in erts/emulator/beam/external.c walks the external term format with an explicit work list, so nested tuples, lists and maps do not grow the C stack. decodedsize runs first and sizes the input the same way.

2. Recursive integer fields. Two tags break that pattern. For NEWFUNEXT (112), decterm reads the OldIndex and OldUniq fields by calling itself and checks issmall on the result afterwards. For EXPORTEXT (113), it reads the Arity field the same way. On current release lines the discarded creator pid of NEWFUNEXT is also read by a recursive call. The recursive call accepts any term, so a fun placed in one of these fields is decoded as a fun, and its own integer fields recurse again.

3. Stack exhaustion. Each nesting level costs one decterm frame on the scheduler thread's stack. decodedsize accepts the input because it only counts terms and heap words. An input nested deeply enough overflows the stack before any issmall check fails, and the VM aborts. The depth needed depends on the stack size of the thread, so the input must be correspondingly large.

4. Fix. The fix decodes these fields with a dedicated decint32 that accepts only SMALLINTEGEREXT and INTEGEREXT, and decodes the creator pid through decpid, leaving no recursive call to decterm.

Proof of concept

1. Build a NEWFUNEXT (tag 112) term with a valid module atom and zero free variables. 2. In place of the OldIndex field, which must be a small integer, encode another NEWFUNEXT term. Repeat this nesting until the chain is deep enough to exhaust the stack of a scheduler thread. The OldUniq field, or the Arity field of an EXPORTEXT (tag 113), can carry the nested fun instead. 3. Prefix the result with the version byte 131 and call binarytoterm/1, or binarytoterm/2 with [safe], on it. 4. The VM aborts from stack exhaustion instead of raising badarg.

Impact

An attacker who can supply bytes to binarytoterm/1,2 or enifbinarytoterm() can abort the Erlang VM and stop every application on the node.

Workarounds

Do not call binarytoterm/1,2 on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data. If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification. Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input. Note: the [safe] option to binarytoterm/2 does NOT protect against this crash. It only restricts atom creation, not structural validation of binary encodings.

1 / 2
Source: OSV
First published (updated )
Severity
6.9
AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Uncontrolled Recursion vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binarytoterm/1,2 to abort the Erlang VM via a fun term with funs nested in its integer fields. decterm in erts/emulator/beam/external.c decodes terms iteratively, except for the OldIndex and OldUniq fields of NEWFUNEXT and the Arity field of EXPORTEXT. For these fields it calls itself, and it checks that the result is a small integer only after the call returns. An input that places another fun in such a field, nested to sufficient depth, recurses once per level, exhausts the stack of the scheduler thread and crashes the VM. The input must be large enough to reach that depth.

The abort takes down every process on the node. Supervision, try/catch and the safe option do not prevent it. enifbinarytoterm() and the distribution protocol reach the same decoder, and distribution is assumed to run on trusted networks only.

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. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.

Details

1. Iterative decoder. decterm in erts/emulator/beam/external.c walks the external term format with an explicit work list, so nested tuples, lists and maps do not grow the C stack. decodedsize runs first and sizes the input the same way.

2. Recursive integer fields. Two tags break that pattern. For NEWFUNEXT (112), decterm reads the OldIndex and OldUniq fields by calling itself and checks issmall on the result afterwards. For EXPORTEXT (113), it reads the Arity field the same way. On current release lines the discarded creator pid of NEWFUNEXT is also read by a recursive call. The recursive call accepts any term, so a fun placed in one of these fields is decoded as a fun, and its own integer fields recurse again.

3. Stack exhaustion. Each nesting level costs one decterm frame on the scheduler thread's stack. decodedsize accepts the input because it only counts terms and heap words. An input nested deeply enough overflows the stack before any issmall check fails, and the VM aborts. The depth needed depends on the stack size of the thread, so the input must be correspondingly large.

4. Fix. The fix decodes these fields with a dedicated decint32 that accepts only SMALLINTEGEREXT and INTEGEREXT, and decodes the creator pid through decpid, leaving no recursive call to decterm.

Proof of concept

1. Build a NEWFUNEXT (tag 112) term with a valid module atom and zero free variables. 2. In place of the OldIndex field, which must be a small integer, encode another NEWFUNEXT term. Repeat this nesting until the chain is deep enough to exhaust the stack of a scheduler thread. The OldUniq field, or the Arity field of an EXPORTEXT (tag 113), can carry the nested fun instead. 3. Prefix the result with the version byte 131 and call binarytoterm/1, or binarytoterm/2 with [safe], on it. 4. The VM aborts from stack exhaustion instead of raising badarg.

Impact

An attacker who can supply bytes to binarytoterm/1,2 or enifbinarytoterm() can abort the Erlang VM and stop every application on the node.

Workarounds

Do not call binarytoterm/1,2 on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data. If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification. Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input. Note: the [safe] option to binarytoterm/2 does NOT protect against this crash. It only restricts atom creation, not structural validation of binary encodings.

1 / 2
Source: OSV
First published (updated )
Severity
7
AV:L/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Out-of-bounds Write vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binarytoterm/1,2 to abort the Erlang VM via a NEWERREFERENCEEXT term with a zero-length ID. decodedsize in erts/emulator/beam/external.c accepts a reference whose 16-bit Len field is zero, but decterm always reads one ID word. decterm then runs 4 bytes ahead of the position that decodedsize validated. It decodes the bytes that follow as terms that were never sized, and writes past the reserved process heap.

The abort takes down every process on the node. Supervision, try/catch and the safe option do not prevent it. enifbinarytoterm() and the distribution protocol reach the same decoder, and distribution is assumed to run on trusted networks only. NEWREFERENCEEXT also accepts a zero length, but its range check on the first ID word rejects the shifted input. On 32-bit builds, a zero-length reference of either type at the end of the input, followed by trailing bytes, can write one word past the reserved heap.

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. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.

Details

1. Size pass. binarytotermint first calls decodedsize to reserve the process heap. For NEWERREFERENCEEXT, decodedsize rejects an ID-word count above ERTSMAXREFNUMBERS but not a count of zero. With Len 0 it skips the tag, the length, the node atom and the 4-byte creation, and no ID bytes.

2. Decode pass. decterm reads Len, the node atom and the creation, then reads the first ID word r0 without checking Len. From here decterm is 4 bytes ahead of the position decodedsize validated.

3. Heap overrun. In the reported input, the reference is followed by a BINARYEXT. decodedsize treats the binary payload as opaque bytes. The shifted decterm consumes the binary tag and the top three length bytes as r0, reads the low length byte (105, LARGETUPLEEXT) as the next tag, and builds a tuple from the payload. The tuple-build loop stores past the heap that was reserved for a reference and a binary.

4. Abort. After decterm returns, binarytotermint compares the heap pointer with the reserved end and calls ertsexit with heap overrun. That check runs after the out-of-bounds stores. Larger inputs can fault with SIGSEGV first.

NEWREFERENCEEXT. Tag 114 also accepts Len 0, but decterm rejects r0 >= MAXREFERENCE for that tag. A shifted r0 begins with a term tag byte, so the input fails with badarg.

Proof of concept

1. Build a NEWERREFERENCEEXT (tag 90) with Len 0, the node atom nonode@nohost as SMALLATOMUTF8EXT, and a 4-byte creation for another node, for example 1. 2. Build a BINARYEXT (tag 109) whose payload starts with a 32-bit arity N, followed by N SMALLINTEGEREXT elements. Pad the payload so that the low byte of the 32-bit binary length is 105 (LARGETUPLEEXT). 3. Wrap both in a two-element SMALLTUPLEEXT after the version byte 131. With N = 40 the input is 391 bytes. 4. Call binarytoterm/1, or binarytoterm/2 with [safe], on the input. The VM aborts with heap overrun by 33 words(s) instead of raising badarg.

Impact

An attacker who can supply bytes to binarytoterm/1,2 or enifbinarytoterm() can abort the Erlang VM and stop every application on the node.

Workarounds

Do not call binarytoterm/1,2 on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data. If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification. Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input. Note: the [safe] option to binarytoterm/2 does NOT protect against this crash. It only restricts atom creation, not structural validation of binary encodings.

1 / 2
Source: OSV
First published (updated )
Severity
6.9
XEE
AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Improper Restriction of XML External Entity Reference vulnerability in xmerlscan in Erlang OTP xmerl allows an attacker to exhaust the memory of the Erlang VM via an XML document that names an external DTD.

With default options, xmerlscan:string/1,2 and xmerlscan:file/1,2 fetch and parse the external DTD named in a <!DOCTYPE root SYSTEM "..."> declaration. fetchDTD/2 in lib/xmerl/src/xmerlscan.erl passes every system identifier to the default fetch function, which maps file: and absolute URIs to local paths, and intfiledecl/3 then reads the whole file with file:readfile/1. This happens whether or not validation is enabled, and the allowentities option, which is false by default since OTP 27, only governs <!ENTITY> declarations and does not stop the fetch. A document naming file:///dev/zero makes the node read without bound until the operating system kills it for lack of memory, and the parse never returns.

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 xmerl from 1.3.7 before 2.1.3.4, 2.1.9.1, and 2.2.1. Whether OTP before OTP 17.0, corresponding to xmerl before 1.3.7, is affected is unknown.

Details

1. DOCTYPE handling. scandoctype2/3 and scandoctype3/3 in lib/xmerl/src/xmerlscan.erl call fetchDTD/2 once the <!DOCTYPE> declaration ends. fetchDTD/2 has no clause that skips the fetch when validation is off (that clause is commented out), so every system identifier reaches fetchandparse/3.

2. Default fetch. fetchandparse/3 calls the scanner's fetchfun, which defaults to fetch/2. Its helper fetchURI/2 treats the identifier as a filename: a file: URI or an absolute path resolves to that local path, and a relative name resolves against xmlbase. Only http: identifiers are left unread.

3. Unbounded read. The returned {file, Path} goes to intfiledecl/3, which calls file:readfile/1 on the path and converts the result to a list. file:readfile/1 reads until end of file, so a device such as /dev/zero never returns and the binary heap grows until the operating system kills the VM. The allowentities default of false does not help: it only rejects <!ENTITY> declarations in scanmarkupdecl/2, which runs after the file has been read.

Proof of concept

1. Build an XML document whose DOCTYPE names an unbounded local resource, for example <?xml version="1.0"?><!DOCTYPE root SYSTEM "file:///dev/zero"><root/>. 2. Parse it with xmerlscan:string/1 with default options on a Unix host. 3. The call never returns. The reporter observed binary memory reaching 8, 16, 32 and 64 GB within five seconds on OTP 29.1.2, after which the node was killed for lack of memory.

Impact

An attacker who can supply an XML document to an application that parses it with xmerlscan using default options makes the node read an unbounded local resource such as /dev/zero. The read exhausts memory and takes the node down for every user of the application.

Workarounds

Pass a fetchfun that refuses external resources in the option list of xmerlscan:string/2 or xmerlscan:file/2, for example {fetchfun, fun(ExtSpec, State) -> {ok, notfetched, State} end}. The scanner then continues without reading or parsing the external DTD.

1 / 2
Source: OSV
First published (updated )
Severity
8.2
AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Allocation of Resources Without Limits or Throttling vulnerability in Erlang OTP inets (httpdscriptenv module) allows an unauthenticated remote attacker to exhaust the atom table of an httpd server that serves ESI scripts.

When modesi builds the environment for an ESI callback, httpdscriptenv:httpenvelement/3 checks that a request header name already exists as an atom, then creates the atom http<header-name> with listtoatom/1. Atoms are never garbage collected, and each new atom passes the existence check on a later request. So a header named node creates httpnode, a header named httpnode creates httphttpnode, and so on. A stream of requests to any ESI URL grows the atom table until it reaches its limit (+t), and then the whole Erlang VM aborts, together with every application on the node.

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 inets from 5.10 before 9.3.2.9, 9.6.2.5, and 9.8.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.

Proof of concept

1. Start httpd with {erlscriptalias, {"/esi", [Mod]}}, where Mod exports any ESI callback fun/3. 2. Send GET /esi/Mod:fun with a request header named node. The node now holds the atom httpnode. 3. Send the same request with a header named httpnode. The node now holds httphttpnode. 4. Repeat with each new name. Each request adds an atom that persists, until the atom table limit aborts the VM.

Impact

An unauthenticated remote client can permanently grow the atom table of the node with ordinary HTTP requests. When the table reaches its limit, the Erlang VM aborts and takes down every application on the node, not only httpd.

Workarounds

If you do not need ESI, remove erlscriptalias from the httpd configuration. Restrict the ESI URL prefixes to trusted clients, for example with modauth directory protection. Authenticated clients can still trigger the issue. Put httpd behind a reverse proxy that forwards only an allowlist of standard request headers to the ESI URL prefixes. For nginx, set proxypassrequestheaders off and add one proxysetheader for each allowed header.

Configurations

Only httpd servers with at least one erlscriptalias configured are affected, and only for clients that can reach an ESI URL prefix. Where modauth or modsecurity directory protection sits in front of modesi, only authenticated clients can trigger the issue. CGI scripts served by modcgi and the httpc client are not affected.

1 / 2
Source: OSV
First published (updated )
Severity
2.1
AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N

Summary

Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting') vulnerability in Erlang OTP inets (httpc module) allows HTTP Request Splitting.

httpc writes request header names and values to the wire without neutralizing CR, LF or NUL characters. On the default path httprequest:mkkeyvaluestr/2, and with the headersasis option httpcrequest:httpheaders/2, build each header line by plain concatenation of the name, ": ", the value and CRLF. A CR/LF in a name or value ends the header line early. An attacker who controls data that an application puts into a header passed to httpc:request/4,5 can add or override request headers, or append a second request on the same connection.

Applications that pass only constant or validated header names and values are not affected. The request line is not affected, because uristring rejects URLs that contain raw CR/LF.

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 inets from 5.10 before 9.3.2.9, 9.6.2.5, and 9.8.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.

Proof of concept

1. Start a TCP listener that prints the bytes it receives, for example on localhost:4444. 2. Call httpc:request(get, {"http://localhost:4444", [{"a: b\r\nc", "d\r\ne: f"}]}, [], []). 3. The listener receives three header lines (a: b, c: d, e: f) instead of one. 4. Repeat with [{headersasis, true}] as the fourth argument and an explicit host header. The same three lines arrive.

Impact

An attacker who controls data in a request header can add or override headers such as Authorization, Cookie, Host or X-Forwarded-For, which may affect authentication, routing or caching decisions on the target server or on intermediaries. With an empty line, the attacker can send a second, attacker-chosen request to the target server over the connection that the application opened.

Workarounds

Validate request header names and values before you pass them to httpc:request/4,5. Reject or replace any name or value that contains CR (\r), LF (\n) or NUL (\0), and accept only header names made of RFC 9110 token characters. Where the application forwards headers from another source, use a fixed allowlist of header names.

1 / 2
Source: OSV
First published (updated )
Severity
8.7
AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Improper Validation of Specified Quantity in Input vulnerability in the BER decoder in Erlang/OTP snmp allows an unauthenticated remote attacker to exhaust CPU via an SNMP message that contains an OBJECT IDENTIFIER with a very long sub-identifier.

snmppdus:decoidelement/3 does not limit the number of base-128 octets in a sub-identifier, and snmppdus:decoidelements/3 does not limit the number of sub-identifiers, so one sub-identifier can span the whole datagram. When the value exceeds the native integer size, each further octet copies a growing bignum, and decoding time grows quadratically with the sub-identifier length. The agent and the manager decode OIDs before they check community strings or SNMPv3 credentials, inside the single network interface process (snmpanetif or snmpmnetif). That process does not read the next datagram until decoding completes.

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 snmp from 4.25.1 before 5.18.2.3, 5.20.2.4, and 5.20.7. Whether OTP before OTP 17.0, corresponding to snmp before 4.25.1, is affected is unknown.

Impact

An unauthenticated remote attacker who can send UDP datagrams to an SNMP agent or manager can keep its network interface process busy with a low rate of crafted messages. The agent or manager then stops processing legitimate SNMP traffic while the attack continues.

Workarounds

Restrict network access to the SNMP agent and manager UDP ports to trusted management hosts only, using firewall rules or by binding the agent to a dedicated management interface. Disable SNMPv1 and SNMPv2c in the agent if they are not needed. This reduces, but does not eliminate, the exposure, since SNMPv3 discovery messages are still decoded before authentication.

Note that community strings and SNMPv3 credentials do not mitigate this issue, since decoding happens before they are checked.

1 / 2
Source: OSV
First published (updated )
Severity
5.9
Buffer Overflow
AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

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 &#576460752303423488; 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.

Details

1. Code generation. BeamModuleAssembler::emitisgelt in erts/emulator/beam/jit/arm/instrcommon.cpp emits the isgelt instruction, which the compiler produces for a chained guard of the form A =< X, X < B. The AArch64 emitter wraps the whole sequence in preservecache and declares TMP1 as the only clobbered register, so the register cache keeps its entries across the instruction.

2. Generic path. When the operand is not a small integer, the generated code loads it into ARG1 and calls the global fragment BeamGlobalAssembler::emitisgeltshared. The fragment performs a generic term comparison and overwrites ARG1 and other caller-saved registers.

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.

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.

5. Trigger. The ?ischar guard in lib/xmerl/src/xmerlsaxparserbase.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 fatalerror naming an illegal character.

The fix removes the preservecache wrapper so the cache is invalidated after the instruction, matching emitisinrange. The x86-64 emitter never preserved the cache here.

Proof of concept

1. Run an AArch64 build of OTP 27 or later with the JIT enabled; erlang:systeminfo(emuflavor) returns jit. 2. Parse an XML document that contains a numeric character reference too large for a small integer, for example <a>&#576460752303423488;</a>, with xmerlsaxparser:stream/2 or xmerlsaxparser:file/2. No entity expansion or external resource is needed. 3. The emulator exits with SIGSEGV (status 139) instead of returning {fatalerror, , "Not a legal character: #576460752303423488", , }.

Impact

An 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.

Workarounds

On AArch64 hosts, run the emulator without the JIT: start it with erl -emuflavor emu when the interpreter flavor is installed, or build OTP with --disable-jit. The interpreter does not execute the affected generated code.

Configurations

Only AArch64 (ARM64) runtimes that execute the JIT are affected; erlang:systeminfo(emuflavor) 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 xmerlsaxparser, but other Erlang code that compiles to the same chained range guard over a non-small integer can reach the same defect.

1 / 2
Source: OSV
First published (updated )
Severity
5.7
Use After Free
AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

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.

1 / 2
Source: OSV
First published (updated )
Severity
5.7
Use After Free
AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

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.

1 / 2
Source: OSV
First published (updated )
Severity
6.9
AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Out-of-bounds Read vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binarytoterm/1,2 to read memory after the input, and to change one byte there, via a FLOATEXT term without a terminating zero byte. decodedsize in erts/emulator/beam/external.c checks only that the 31 bytes of the FLOATEXT field are present. decterm then passes the field to syscharstodouble, which scans to a NUL byte without a length limit. When the field has no NUL, the scan continues into the bytes after the field, and those bytes change the decoded float. When the radix character is found after the field and strtod does not accept it, syscharstodouble overwrites that byte (a , becomes a .). The VM can fault if the scan reaches an unmapped page.

The safe option does not prevent this. enifbinarytoterm() and the distribution protocol reach the same decoder, and distribution is assumed to run on trusted networks only. The write is limited to the one radix byte. No arbitrary write or code execution was shown.

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. Whether OTP before OTP 17.0, corresponding to erts before 6.0, is affected is unknown.

Details

1. Size pass. binarytotermint first calls decodedsize in erts/emulator/beam/external.c. For FLOATEXT (tag 99), decodedsize skips 31 bytes and reserves heap for one float. It does not examine the content of the field.

2. Decode pass. decterm passes the pointer to the field to syscharstodouble and then advances by 31 bytes. The call carries no length. syscharstodouble (in erts/emulator/sys/unix/sysfloat.c and erts/emulator/sys/win32/sysfloat.c) treats the field as a C string.

3. Out-of-bounds read. syscharstodouble checks the float syntax one character at a time and requires a NUL after the last digit. A valid encoder pads the field with NUL bytes. When all 31 bytes are part of a float, the scan and the subsequent strtod call continue into the bytes after the field. When the field is the last term of the input, these are bytes after the input. If they complete a valid float and a NUL follows, the decoded value contains them.

4. One-byte write. syscharstodouble remembers the position of the radix character, which can be . or ,. If strtod stops before the end of the scanned string, the function replaces the radix character with the other one in place and calls strtod again. When the field contains only digits, the radix character is a byte after the field. A , there is changed to ..

5. Fault. The scan has no upper limit. If only digits follow up to the end of the mapped memory, the read faults and the VM aborts.

Proof of concept

1. Build a FLOATEXT field without a NUL byte: tag 99 followed by the 31 bytes 1.0e plus 26 times 0 plus 1. This is the float 10.0. 2. Put the field at the end of an input, for example as the last element of a SMALLTUPLEEXT after the version byte 131. 3. Build a larger binary that holds the input followed by the bytes 7 and NUL. Take the input as a sub-binary with binary:part/3. 4. Call binarytoterm/2 with [safe] on the sub-binary. The last element decodes as 1.0e17 and not 10.0: the decoder read the 7 after the input. 5. For the write, use the 31 digits 1234567890123456789012345678901 as the field and put ,5 and NUL after the input. After the call, the , byte in the parent binary is a ..

Impact

An attacker who can supply bytes to binarytoterm/1,2 or enifbinarytoterm() can make the decoder read bytes after the input, which then change the decoded float, and can change one , byte after the input to .. The VM can abort if the read reaches unmapped memory.

Workarounds

Do not call binarytoterm/1,2 on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data. If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification. Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input. Note: the [safe] option to binarytoterm/2 does NOT protect against this issue. It only restricts atom creation, not structural validation of binary encodings.

1 / 2
Source: OSV
First published (updated )
Severity
9.1
AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Summary

Improper Verification of Cryptographic Signature vulnerability in Erlang OTP ssl (sslhandshake module) allows an on-path attacker to impersonate any server to a TLS 1.2 or DTLS client.

When a server sends no Certificate message and a ServerKeyExchange without a signature, sslhandshake:decodeserverkey/3 reports the signature algorithm as anon, and sslhandshake:verifysignature/5 returns true for anon without a public key. The client does not require a certificate for a certificate-authenticated key exchange, so the handshake completes for the ecdhersa, ecdheecdsa, dhersa and dhedss key exchanges with a cipher suite the client offered. Certificate path validation, verifyfun and the hostname check do not run, and ssl:connect/3 returns {ok, Socket} with {verify, verifypeer} set. The TLS 1.3 client is not affected.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.14, OTP 28.5.0.9, and OTP 29.0.3, corresponding to ssl from 5.3.4 before 11.2.12.10, 11.6.0.8, and 11.7.3.

Details

1. Signature decoding. sslhandshake:decodeserverkey/3 splits the ServerKeyExchange body into the key exchange parameters and a signature. The internal decserverkeysignature/3 maps an empty remainder, a zero-length signature, and the TLS 1.2 anonymous signature algorithm with an empty signature to the signature algorithm anon. It does this for every key exchange algorithm, not only for the anonymous ones.

2. Signature verification. In the certify state the client calls sslhandshake:verifyserverkey/5 for the non-anonymous key exchanges. No Certificate message arrived, so the stored public key is undefined. sslhandshake:verifysignature/5 has a clause that returns true for the anon signature algorithm with any key, and that clause matches.

3. Handshake completion. The client does not check that it received a certificate before it handles ServerHelloDone. It derives the master secret from the unauthenticated (EC)DH parameters and sends ClientKeyExchange, ChangeCipherSpec and Finished. The attacker holds the (EC)DH private key and completes the handshake. ssl:connect/3 returns {ok, Socket}, and ssl:peercert/1 returns {error, nopeercert} on that socket.

Proof of concept

1. Start a TCP server that answers a TLS 1.2 ClientHello with a ServerHello that selects an offered ECDHERSA suite (for example TLSECDHERSAWITHAES128GCMSHA256), then a ServerKeyExchange with x25519 parameters and no signature, then ServerHelloDone. Send no Certificate message. The UnauthenticatedECDH test of the BoringSSL test runner (BoGo) provides such a server. 2. Connect with ssl:connect/3 and the options {verify, verifypeer}, {cacerts, publickey:cacertsget()}, {servernameindication, "www.example.com"} and {customizehostnamecheck, [{matchfun, publickey:pkixverifyhostnamematchfun(https)}]}. 3. On the server, derive the session keys from its own ECDH key pair and the client's ClientKeyExchange, then send ChangeCipherSpec and Finished. 4. ssl:connect/3 returns {ok, Socket}, and the server decrypts the application data that the client sends. A fixed client aborts with a fatal alert after step 1.

Impact

An on-path attacker can impersonate any server to an affected client, then read and modify all application data on the connection. Certificate path validation, verifyfun and the hostname check do not run.

Workarounds

Restrict TLS client connections to TLS 1.3 by setting versions to ['tlsv1.3'] in the client's ssl options.

If a client must use TLS 1.2, offer only the static RSA key exchange cipher suites. These suites have no ServerKeyExchange message. They provide no forward secrecy, and many servers do not accept them.

erlang RsaOnly = ssl:filterciphersuites( ssl:ciphersuites(all, 'tlsv1.2'), [{keyexchange, fun(rsa) -> true; () -> false end}] ), Opts = [ {verify, verifypeer}, {cacerts, publickey:cacertsget()}, {versions, ['tlsv1.2']}, {ciphers, RsaOnly}, {servernameindication, "www.example.com"}, {customizehostnamecheck, [ {matchfun, publickey:pkixverifyhostnamematchfun(https)} ]} ].

Configurations

The vulnerability affects clients whose connection can use TLS 1.2 or DTLS 1.2. The default ssl:connect options allow TLS 1.2. Clients restricted to TLS 1.3 are not affected. Cipher suites that do not use a ServerKeyExchange message (the rsa, ecdhrsa and ecdhecdsa key exchanges) are not affected. Servers are not affected. Exploitation requires an on-path (adversary-in-the-middle) attacker between the client and the intended server.

1 / 2
Source: OSV
First published (updated )
Severity
8.2
AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Summary

Inefficient algorithmic complexity in the Erlang/OTP asn1 OBJECT IDENTIFIER decoder allows a remote unauthenticated attacker to cause denial of service by sending a crafted OID during the TLS handshake.

The BER OID decoder asn1rttber:decsubidentifiers/3 in lib/asn1/src/asn1rttber.erl and the equivalent PER helper asn1rttpercommon:decsubidentifiers/3 in lib/asn1/src/asn1rttpercommon.erl accumulate a base-128 subidentifier into an unbounded integer using (Av bsl 7) + H per continuation byte. Each shift and addition on the growing accumulator is linear in the number of bits already accumulated, giving quadratic total work in the size of a single subidentifier. The JER helper asn1rttjer:json2oid/1 in lib/asn1/src/asn1rttjer.erl exhibits the same class of unbounded-integer parsing when decoding a dot-separated OID from JSON. A DER-encoded OBJECT IDENTIFIER with one very large arc (approximately 262 KB of continuation bytes) consumes roughly 13 seconds of CPU on typical hardware.

The vulnerable decoder is generated into every ASN.1 module that contains an OBJECT IDENTIFIER, including OTP-PUB-KEY which is reached during X.509 certificate parsing via publickey:pkixdecodecert/2. This decoder runs before any signature or trust chain verification, so any Erlang service that parses peer TLS certificates is exposed: the default for TLS clients (which always parse the server certificate) and for mutual-TLS servers (which parse client certificates).

This vulnerability is associated with program files lib/asn1/src/asn1rttber.erl, lib/asn1/src/asn1rttpercommon.erl and lib/asn1/src/asn1rttjer.erl and program routines asn1rttber:decsubidentifiers/3, asn1rttpercommon:decsubidentifiers/3 and asn1rttjer:json2oid/1.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.18, OTP 28.5.0.7, and OTP 29.1.1, corresponding to asn1 from 3.0 before 5.3.4.3, 5.4.3.1, and 5.5.2. Whether OTP before OTP 17.0, corresponding to asn1 before 3.0, is affected is unknown.

1 / 4
Source: OSV
First published (updated )
Severity
7.1
AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Allocation of Resources Without Limits or Throttling vulnerability in Erlang/OTP ssh allows an authenticated remote attacker to exhaust node memory by repeatedly opening session channels that are never assigned a handler.

The "session" clause of sshconnection:handlemsg/4 checks only minimalremotemaxpacketsize before calling setupsession/5, which unconditionally builds a #channel{} record and stores it in the ETS channel cache. The maxchannels daemon option is consulted only by sshchannelsup:maxnumchannelsnotexceeded/2, which counts supervisor children, so a channel that never gets a shell, exec, or subsystem handler is invisible to the limit and setting the option to a finite value does not mitigate the attack. RFC 4254 section 5.1 permits many session channels per connection, and each record costs only a few hundred bytes, so a single authenticated connection can accumulate channels until the node runs out of memory and the emulator terminates, affecting every application on it. No file contents, credentials, or write access are obtainable.

This issue affects OTP from OTP 18.1.2 before OTP 27.3.4.18, OTP 28.5.0.7, and OTP 29.1.1, corresponding to ssh from 4.1.1 before 5.2.11.13, 5.5.2.6, and 6.0.6. Whether OTP before OTP 18.1.2, corresponding to ssh before 4.1.1, is affected is unknown.

Workarounds

No option bounds the number of idle session channels, so the following reduce exposure without eliminating the issue.

Restrict network access to the SSH daemon to trusted clients. Exploitation requires a successfully authenticated session, so limiting who can authenticate is the most effective control available. Set the maxsessions daemon option to a finite value to bound the number of concurrent connections. This limits how many connections can mount the attack in parallel, though a single connection still suffices to exhaust memory. Apply operating-system or firewall connection-rate and connection-count limits per source address. Monitor node memory externally and restart the emulator when it exceeds a threshold.

Setting maxchannels is not a workaround: idle session channels bypass that check entirely.

1 / 2
Source: OSV
First published (updated )
Severity
5.3
AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Summary

Allocation of Resources Without Limits or Throttling vulnerability in Erlang OTP ssh (sshsftp modules) allows Excessive Allocation, Resource Leak Exposure.

This vulnerability is associated with program files lib/ssh/src/sshsftpd.erl.

This issue affects OTP from OTP 17.0 before OTP 26.2.5.15, OTP 27.3.4.3, and OTP 28.0.3, corresponding to ssh from 3.0.1 before 5.1.4.12, 5.2.11.3, and 5.3.3.

Workarounds

Disable sftp limiting number of maxsessions allowed for sshd, so exploiting becomes more complicated

Configurations

The SFTP subsystem must be enabled on the SSH server and the SSH port must be reachable by the attacker. SFTP is enabled by default unless explicitly disabled by setting {subsystems, []} in the SSH daemon configuration.

1 / 2
Source: OSV
First published (updated )
Severity
6.9
AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Summary

Uncontrolled Resource Consumption vulnerability in Erlang OTP ssh (sshsftp modules) allows Excessive Allocation, Flooding.

This vulnerability is associated with program files lib/ssh/src/sshsftpd.erl.

This issue affects OTP from OTP 17.0 before OTP 26.2.5.15, OTP 27.3.4.3, and OTP 28.0.3, corresponding to ssh from 3.0.1 before 5.1.4.12, 5.2.11.3, and 5.3.3.

Workarounds

set option parallellogin to false reduce maxsessions option

1 / 2
Source: OSV
First published (updated )
Severity
4.8
Path Traversal
AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:L/SC:N/SI:L/SA:L

Summary

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (stdlib modules) allows Absolute Path Traversal, File Manipulation.

This vulnerability is associated with program files lib/stdlib/src/zip.erl and program routines zip:unzip/1, zip:unzip/2, zip:extract/1, zip:extract/2 unless the memory option is passed.

This issue affects OTP from OTP 17.0 before OTP 26.2.5.13, OTP 27.3.4.1, and OTP 28.0.1, corresponding to stdlib from 2.0 before 5.2.3.4, 6.2.2.1, and 7.0.1.

Workarounds

You can use zip:listdir/1 on the archive and verify that no files contain absolute paths before extracting the archive to disk.

1 / 2
Source: OSV
First published (updated )
Severity
4.8
Path Traversal
AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:L/SC:N/SI:L/SA:L

Summary

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Erlang OTP (stdlib modules) allows Absolute Path Traversal, File Manipulation.

This vulnerability is associated with program files lib/stdlib/src/zip.erl and program routines zip:unzip/1, zip:unzip/2, zip:extract/1, zip:extract/2 unless the memory option is passed.

This issue affects OTP from OTP 17.0 before OTP 26.2.5.13, OTP 27.3.4.1, and OTP 28.0.1, corresponding to stdlib from 2.0 before 5.2.3.4, 6.2.2.1, and 7.0.1.

Workarounds

You can use zip:listdir/1 on the archive and verify that no files contain absolute paths before extracting the archive to disk.

1 / 2
Source: OSV
First published (updated )
Severity
9.3
AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Summary

Key Exchange without Entity Authentication vulnerability in Erlang/OTP ssl allows a peer that answers a TLS 1.3 client connection to impersonate the intended server. A presharedkey extension in the ServerHello that the client never offered causes the client to complete the handshake without validating the server's certificate, so ssl:connect returns {ok, Socket} against a peer holding no certificate, no private key and no prior session.

tlsclientconnection13:handleserverhello/2 passes the received extension to tlsgenconnection13:handleresumption/2, which sets resumption = true on its mere presence without checking that the client offered a PSK. tlshandshake13:getpresharedkey/4 meanwhile falls back to the all-zero "no PSK" value and keys the handshake with the ordinary non-PSK schedule, so the attacker's own ephemeral key suffices. The resumption flag then routes mayberesumption/1 straight to waitfinished, skipping the certificate-handling states, so certificate path validation, verifyfun, hostname verification, partialchain, CRL checking and OCSP stapling are all bypassed. The default client configuration is affected; clients restricted to TLS 1.2 are not.

This issue affects OTP from OTP 22.2 before OTP 27.3.4.18, OTP 28.5.0.7, and OTP 29.1.1, corresponding to ssl from 9.5 before 11.2.12.13, 11.6.0.6, and 11.7.7.

Impact

An attacker that answers a TLS 1.3 client connection, either as the host the client dials or as an on-path attacker, completes the handshake as the intended server and holds all traffic keys. It can read everything the application sends, including credentials, tokens and request bodies, and forge every response. Any consumer of ssl:connect that negotiates TLS 1.3 is affected, including httpc over HTTPS, database and messaging client libraries, and TLS distribution clients.

Workarounds

Restrict affected clients to TLS 1.2 by setting {versions, ['tlsv1.2']} in the client's ssl options. This avoids the vulnerable code path at the cost of losing TLS 1.3.

No configuration both keeps TLS 1.3 and mitigates the issue.

1 / 2
Source: OSV
First published (updated )
Severity
8.7
AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Summary

Allocation of Resources Without Limits or Throttling vulnerability in Erlang/OTP inets httpd allows an unauthenticated remote attacker to cause denial of service by opening and holding open a large number of connections. The maxclients option is documented to default to 150, and the inets hardening guide presents that limit as the first layer of denial-of-service defence, but a server that does not set it explicitly accepts an unlimited number of simultaneous connections. Establishing the connections is sufficient; no valid request and no authentication are required.

The accept gate in httpdmanager:handlenewconnection/4 reads the option with httpdutil:lookup/2, which returns undefined when the key is absent, rather than the three-argument form carrying the 150 default that the neighbouring getustate/2 uses. Erlang term ordering places every integer before every atom, so the Count =< Max guard holds for any connection count and the server never returns {reject, busy}. Each accepted connection occupies a worker process and a socket for as long as it is held, driving the node towards process, memory and file descriptor exhaustion. Servers that set maxclients explicitly are unaffected, because a configured value is applied as intended.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.17, OTP 28.5.0.6, and OTP 29.0.6, corresponding to inets from 5.10 before 9.3.2.7, 9.6.2.3, and 9.7.2.

Workarounds

Set maxclients explicitly in the httpd configuration, for example {maxclients, 150}. An explicitly configured value is read by the same accept gate and applied as intended, so this restores the documented limit without upgrading. Limit concurrent connections in front of httpd, for example with reverse proxy or firewall connection-count and connection-rate rules. Restrict access to the server to trusted clients where the deployment allows it.

Configurations

Only servers that do not set maxclients in the httpd configuration are affected. A server that sets the option to any integer value applies the limit as intended.

1 / 7
Source: OSV
First published (updated )
Severity
8.3
AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N

Summary

httpd function checkheader/3 rejects duplicate Content-Length (per CVE-2026-23941) but never checks for the TE+CL co-presence that RFC 9112 §6.3 identifies as a probable smuggling attempt. handlebody/3 frames by chunked and silently discards Content-Length. A CL-preferring front-end paired with chunked-preferring inets creates a classic CL.TE front-end/back-end desync.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.17, OTP 28.5.0.6, and OTP 29.0.6, corresponding to inets from 5.10 before 9.3.2.7, 9.6.2.3, and 9.7.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.

1 / 2
Source: OSV
First published (updated )
Severity
8.3
AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N

Summary

httpd function checkheader/3 rejects duplicate Content-Length (per CVE-2026-23941) but never checks for the TE+CL co-presence that RFC 9112 §6.3 identifies as a probable smuggling attempt. handlebody/3 frames by chunked and silently discards Content-Length. A CL-preferring front-end paired with chunked-preferring inets creates a classic CL.TE front-end/back-end desync.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.17, OTP 28.5.0.6, and OTP 29.0.6, corresponding to inets from 5.10 before 9.3.2.7, 9.6.2.3, and 9.7.2. Whether OTP before OTP 17.0, corresponding to inets before 5.10, is affected is unknown.

1 / 2
Source: OSV
First published (updated )

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