{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-120961","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","state":"PUBLISHED","assignerShortName":"EEF","dateReserved":"2026-11-10T11:01:31.673Z","datePublished":"2026-11-24T15:10:40.813Z","dateUpdated":"2026-11-24T15:10:40.813Z"},"containers":{"cna":{"affected":[{"cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"defaultStatus":"unknown","modules":["erlang","external","erl_nif","sys_float"],"packageName":"erts","packageURL":"pkg:otp/erts?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git","product":"OTP","programFiles":["emulator/beam/external.c","emulator/beam/erl_nif.c","emulator/sys/unix/sys_float.c","emulator/sys/win32/sys_float.c"],"programRoutines":[{"name":"erlang:binary_to_term/1"},{"name":"erlang:binary_to_term/2"},{"name":"dec_term"},{"name":"enif_binary_to_term"},{"name":"sys_chars_to_double"}],"repo":"https://github.com/erlang/otp","vendor":"Erlang","versions":[{"changes":[{"at":"15.2.7.15","status":"unaffected"},{"at":"16.4.0.8","status":"unaffected"},{"at":"17.1.2","status":"unaffected"}],"lessThan":"*","status":"affected","version":"6.0","versionType":"otp"}]},{"cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"defaultStatus":"unknown","modules":["erlang","external","erl_nif","sys_float"],"packageName":"otp","packageURL":"pkg:software-id/erlang.org/otp","product":"OTP","programFiles":["erts/emulator/beam/external.c","erts/emulator/beam/erl_nif.c","erts/emulator/sys/unix/sys_float.c","erts/emulator/sys/win32/sys_float.c"],"programRoutines":[{"name":"erlang:binary_to_term/1"},{"name":"erlang:binary_to_term/2"},{"name":"dec_term"},{"name":"enif_binary_to_term"},{"name":"sys_chars_to_double"}],"vendor":"Erlang","versions":[{"changes":[{"at":"27.3.4.20","status":"unaffected"},{"at":"28.5.0.9","status":"unaffected"},{"at":"29.1.3","status":"unaffected"}],"lessThan":"*","status":"affected","version":"17.0","versionType":"otp"}]},{"collectionURL":"https://github.com","cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"defaultStatus":"unknown","modules":["erlang","external","erl_nif","sys_float"],"packageName":"erlang/otp","packageURL":"pkg:github/erlang/otp","product":"OTP","programFiles":["erts/emulator/beam/external.c","erts/emulator/beam/erl_nif.c","erts/emulator/sys/unix/sys_float.c","erts/emulator/sys/win32/sys_float.c"],"programRoutines":[{"name":"erlang:binary_to_term/1"},{"name":"erlang:binary_to_term/2"},{"name":"dec_term"},{"name":"enif_binary_to_term"},{"name":"sys_chars_to_double"}],"repo":"https://github.com/erlang/otp","vendor":"Erlang","versions":[{"lessThan":"4b954b8aa0f601a0d8d45f0953c77585afb6f853","status":"affected","version":"84adefa331c4159d432d22840663c38f155cd4c1","versionType":"git"},{"lessThan":"*","status":"unaffected","version":"4b954b8aa0f601a0d8d45f0953c77585afb6f853","versionType":"git"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"27.3.4.20","vulnerable":true},{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"28.5.0.9","versionStartIncluding":"28.0","vulnerable":true},{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"29.1.3","versionStartIncluding":"29.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Khaled Suliman"},{"lang":"en","type":"reporter","value":"Khaled Suliman"},{"lang":"en","type":"coordinator","value":"Jonatan Männchen / EEF"}],"dateAssigned":"2026-11-11T12:24:29.000Z","datePublic":"2026-11-24T15:10:39.000Z","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Out-of-bounds Read vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to <code>binary_to_term/1,2</code> to read memory after the input, and to change one byte there, via a <code>FLOAT_EXT</code> term without a terminating zero byte. <code>decoded_size</code> in <code>erts/emulator/beam/external.c</code> checks only that the 31 bytes of the <code>FLOAT_EXT</code> field are present. <code>dec_term</code> then passes the field to <code>sys_chars_to_double</code>, 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 <code>strtod</code> does not accept it, <code>sys_chars_to_double</code> overwrites that byte (a <code>,</code> becomes a <code>.</code>). The VM can fault if the scan reaches an unmapped page.</p>\n<p>The <code>safe</code> option does not prevent this. <code>enif_binary_to_term()</code> 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.</p>\n<p>This issue affects OTP from OTP&nbsp;17.0 before OTP&nbsp;27.3.4.20, OTP&nbsp;28.5.0.9, and OTP&nbsp;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&nbsp;17.0, corresponding to erts before 6.0, is affected is unknown.</p>"},{"base64":false,"type":"text/markdown","value":"Out-of-bounds Read vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to `binary_to_term/1,2` to read memory after the input, and to change one byte there, via a `FLOAT_EXT` term without a terminating zero byte. `decoded_size` in `erts/emulator/beam/external.c` checks only that the 31 bytes of the `FLOAT_EXT` field are present. `dec_term` then passes the field to `sys_chars_to_double`, 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, `sys_chars_to_double` overwrites that byte (a `,` becomes a `.`). The VM can fault if the scan reaches an unmapped page.\n\nThe `safe` option does not prevent this. `enif_binary_to_term()` 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.\n\nThis 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."}],"value":"Out-of-bounds Read vulnerability in the external term format decoder in Erlang OTP erts allows an attacker who controls the input to binary_to_term/1,2 to read memory after the input, and to change one byte there, via a FLOAT_EXT term without a terminating zero byte. decoded_size in erts/emulator/beam/external.c checks only that the 31 bytes of the FLOAT_EXT field are present. dec_term then passes the field to sys_chars_to_double, 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, sys_chars_to_double overwrites that byte (a , becomes a .). The VM can fault if the scan reaches an unmapped page.\n\nThe safe option does not prevent this. enif_binary_to_term() 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.\n\nThis 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."}],"impacts":[{"capecId":"CAPEC-540","descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>An attacker who can supply bytes to <code>binary_to_term/1,2</code> or <code>enif_binary_to_term()</code> can make the decoder read bytes after the input, which then change the decoded float, and can change one <code>,</code> byte after the input to <code>.</code>. The VM can abort if the read reaches unmapped memory.</p>"},{"base64":false,"type":"text/markdown","value":"An attacker who can supply bytes to `binary_to_term/1,2` or `enif_binary_to_term()` 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."}],"value":"An attacker who can supply bytes to binary_to_term/1,2 or enif_binary_to_term() 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."}]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"NONE","attackVector":"LOCAL","baseScore":6.9,"baseSeverity":"MEDIUM","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-125","description":"CWE-125 Out-of-bounds Read","lang":"en","type":"CWE"}]}],"providerMetadata":{"orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF","dateUpdated":"2026-11-24T15:10:40.813Z"},"references":[{"name":"binary_to_term Heap Overrun via FLOAT_EXT Without Terminating Zero Byte May Abort the VM","tags":["vendor-advisory","related"],"url":"https://github.com/erlang/otp/security/advisories/GHSA-r7pf-rpq8-5pf4"},{"name":"EEF CNA record for CVE-2026-120961","tags":["related"],"url":"https://cna.erlef.org/cves/CVE-2026-120961.html"},{"name":"OSV record EEF-CVE-2026-120961","tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-120961"},{"name":"Erlang/OTP version ordering","tags":["x_version-scheme"],"url":"https://www.erlang.org/doc/system/versions.html#order-of-versions"},{"name":"Fix commit 4b954b8 in erlang/otp","tags":["patch"],"url":"https://github.com/erlang/otp/commit/4b954b8aa0f601a0d8d45f0953c77585afb6f853"}],"source":{"discovery":"EXTERNAL"},"title":"binary_to_term Heap Overrun via FLOAT_EXT Without Terminating Zero Byte May Abort the VM","workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<ul>\n<li>Do not call <code>binary_to_term/1,2</code> on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data.</li>\n<li>If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification.</li>\n<li>Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input.\nNote: the <code>[safe]</code> option to <code>binary_to_term/2</code> does NOT protect against this issue. It only restricts atom creation, not structural validation of binary encodings.</li>\n</ul>"},{"base64":false,"type":"text/markdown","value":"* Do not call `binary_to_term/1,2` on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data.\n* If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification.\n* Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input.\nNote: the `[safe]` option to `binary_to_term/2` does NOT protect against this issue. It only restricts atom creation, not structural validation of binary encodings."}],"value":"* Do not call binary_to_term/1,2 on data from untrusted sources. The OTP Secure Coding Guidelines (DSG-011) recommend avoiding these functions altogether on untrusted data.\n* If distribution is exposed to untrusted networks, configure it to use TLS with client certificate verification.\n* Use alternative serialization formats (JSON, Protocol Buffers) for untrusted external input. Note: the [safe] option to binary_to_term/2 does NOT protect against this issue. It only restricts atom creation, not structural validation of binary encodings."}],"x_proofOfConcept":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<ol>\n<li>Build a <code>FLOAT_EXT</code> field without a NUL byte: tag 99 followed by the 31 bytes <code>1.0e</code> plus 26 times <code>0</code> plus <code>1</code>. This is the float 10.0.</li>\n<li>Put the field at the end of an input, for example as the last element of a <code>SMALL_TUPLE_EXT</code> after the version byte 131.</li>\n<li>Build a larger binary that holds the input followed by the bytes <code>7</code> and NUL. Take the input as a sub-binary with <code>binary:part/3</code>.</li>\n<li>Call <code>binary_to_term/2</code> with <code>[safe]</code> on the sub-binary. The last element decodes as <code>1.0e17</code> and not <code>10.0</code>: the decoder read the <code>7</code> after the input.</li>\n<li>For the write, use the 31 digits <code>1234567890123456789012345678901</code> as the field and put <code>,5</code> and NUL after the input. After the call, the <code>,</code> byte in the parent binary is a <code>.</code>.</li>\n</ol>"},{"base64":false,"type":"text/markdown","value":"1. Build a `FLOAT_EXT` 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.\n2. Put the field at the end of an input, for example as the last element of a `SMALL_TUPLE_EXT` after the version byte 131.\n3. 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`.\n4. Call `binary_to_term/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.\n5. 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 `.`."}],"value":"* Build a FLOAT_EXT 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.\n* Put the field at the end of an input, for example as the last element of a SMALL_TUPLE_EXT after the version byte 131.\n* 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.\n* Call binary_to_term/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.\n* 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 .."}],"x_technicalAnalysis":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p><strong>1. Size pass.</strong> <code>binary_to_term_int</code> first calls <code>decoded_size</code> in <code>erts/emulator/beam/external.c</code>. For <code>FLOAT_EXT</code> (tag 99), <code>decoded_size</code> skips 31 bytes and reserves heap for one float. It does not examine the content of the field.</p>\n<p><strong>2. Decode pass.</strong> <code>dec_term</code> passes the pointer to the field to <code>sys_chars_to_double</code> and then advances by 31 bytes. The call carries no length. <code>sys_chars_to_double</code> (in <code>erts/emulator/sys/unix/sys_float.c</code> and <code>erts/emulator/sys/win32/sys_float.c</code>) treats the field as a C string.</p>\n<p><strong>3. Out-of-bounds read.</strong> <code>sys_chars_to_double</code> 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 <code>strtod</code> 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.</p>\n<p><strong>4. One-byte write.</strong> <code>sys_chars_to_double</code> remembers the position of the radix character, which can be <code>.</code> or <code>,</code>. If <code>strtod</code> stops before the end of the scanned string, the function replaces the radix character with the other one in place and calls <code>strtod</code> again. When the field contains only digits, the radix character is a byte after the field. A <code>,</code> there is changed to <code>.</code>.</p>\n<p><strong>5. Fault.</strong> 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.</p>"},{"base64":false,"type":"text/markdown","value":"**1. Size pass.** `binary_to_term_int` first calls `decoded_size` in `erts/emulator/beam/external.c`. For `FLOAT_EXT` (tag 99), `decoded_size` skips 31 bytes and reserves heap for one float. It does not examine the content of the field.\n\n**2. Decode pass.** `dec_term` passes the pointer to the field to `sys_chars_to_double` and then advances by 31 bytes. The call carries no length. `sys_chars_to_double` (in `erts/emulator/sys/unix/sys_float.c` and `erts/emulator/sys/win32/sys_float.c`) treats the field as a C string.\n\n**3. Out-of-bounds read.** `sys_chars_to_double` 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.\n\n**4. One-byte write.** `sys_chars_to_double` 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 `.`.\n\n**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."}],"value":"1. Size pass. binary_to_term_int first calls decoded_size in erts/emulator/beam/external.c. For FLOAT_EXT (tag 99), decoded_size skips 31 bytes and reserves heap for one float. It does not examine the content of the field.\n\n2. Decode pass. dec_term passes the pointer to the field to sys_chars_to_double and then advances by 31 bytes. The call carries no length. sys_chars_to_double (in erts/emulator/sys/unix/sys_float.c and erts/emulator/sys/win32/sys_float.c) treats the field as a C string.\n\n3. Out-of-bounds read. sys_chars_to_double 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.\n\n4. One-byte write. sys_chars_to_double 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 ..\n\n5. 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."}]}}}