CVE-2026-59250
JSON

8.3high

Megaco flex scanner buffer overflow via oversized property parm name

Severity
8.3high CVSS:4.0 by EEF
Exploit likelihood
0.95% (higher than 62% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
EEF
Also known as
EEF-CVE-2026-59250GHSA-7xgh-gmgf-q2g7

Description

Classic buffer overflow in the Erlang/OTP megaco flex scanner C driver allows a remote unauthenticated attacker to corrupt the driver's memory (and potentially achieve remote code execution or a denial-of-service crash) by sending a single text-encoded H.248/Megaco message containing an oversized property parm name. When tokenizing a Local/Remote descriptor, mfs_load_property_groups extracts the attacker-controlled property name (bounded only by the message length) and, when no value follows, formats it into a fixed 512-byte error_msg field of the MfsErlDrvData struct using an unchecked sprintf call. Names longer than roughly 452 bytes overflow into the immediately following struct fields (text_buf, text_ptr, term_spec, term_spec_size, term_spec_index), overwriting live pointers and counters with attacker-chosen bytes. Subsequent scanner code writes and frees through the corrupted pointers, producing arbitrary write and arbitrary free primitives inside the BEAM VM process, which can be leveraged for remote code execution. On builds compiled with _FORTIFY_SOURCE the overflow is detected at runtime and terminates the process with SIGABRT, resulting in denial of service. The overflow occurs in the flex scanner before any grammar or Megaco-level authentication processing, so exploitation requires only network reachability to the megaco transport port on a node configured with {scanner, flex}. This vulnerability is associated with program files lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src and program routines mfs_load_property_groups. This issue affects OTP from OTP 17.0 before OTP 27.3.4.15, OTP 28.5.0.4, and OTP 29.0.4, corresponding to megaco from 3.17.1 before 4.7.2.2, 4.8.3.1, and 4.9.1. Whether OTP before OTP 17.0, corresponding to megaco before 3.17.1, is affected is unknown.

Affected

Product or packageVersionsReported by
megacofrom 3.17.1 before *CVE List
otpfrom 17.0 before *CVE List
erlang/otpfrom 84adefa331c4159d432d22840663c38f155cd4c1 before 8704c8f550a11ed5f825e3c011ecb03565b79c4f
Not affected: from 8704c8f550a11ed5f825e3c011ecb03565b79c4f before *
CVE List
https://github.com/erlang/otpfrom 84adefa331c4159d432d22840663c38f155cd4c1 before 8704c8f550a11ed5f825e3c011ecb03565b79c4fErlang Ecosystem Foundation

All scores

EEF8.3high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N
Erlang Ecosystem FoundationNot scored CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N

Classification

CWE-120CWE-787

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Classic buffer overflow in the Erlang/OTP megaco flex scanner C driver allows a remote unauthenticated attacker to corrupt the driver's memory (and potentially achieve remote code execution or a denial-of-service crash) by sending a single text-encoded H.248/Megaco message containing an oversized property parm name. When tokenizing a Local/Remote descriptor, mfs_load_property_groups extracts the attacker-controlled property name (bounded only by the message length) and, when no value follows, formats it into a fixed 512-byte error_msg field of the MfsErlDrvData struct using an unchecked sprintf call. Names longer than roughly 452 bytes overflow into the immediately following struct fields (text_buf, text_ptr, term_spec, term_spec_size, term_spec_index), overwriting live pointers and counters with attacker-chosen bytes. Subsequent scanner code writes and frees through the corrupted pointers, producing arbitrary write and arbitrary free primitives inside the BEAM VM process, which can be leveraged for remote code execution. On builds compiled with _FORTIFY_SOURCE the overflow is detected at runtime and terminates the process with SIGABRT, resulting in denial of service. The overflow occurs in the flex scanner before any grammar or Megaco-level authentication processing, so exploitation requires only network reachability to the megaco transport port on a node configured with {scanner, flex}. This vulnerability is associated with program files lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src and program routines mfs_load_property_groups. This issue affects OTP from OTP 17.0 before OTP 27.3.4.15, OTP 28.5.0.4, and OTP 29.0.4, corresponding to megaco from 3.17.1 before 4.7.2.2, 4.8.3.1, and 4.9.1. Whether OTP before OTP 17.0, corresponding to megaco before 3.17.1, is affected is unknown.

Erlang Ecosystem Foundation

Summary

Classic buffer overflow in the Erlang/OTP megaco flex scanner C driver allows a remote unauthenticated attacker to corrupt the driver's memory (and potentially achieve remote code execution or a denial-of-service crash) by sending a single text-encoded H.248/Megaco message containing an oversized property parm name.

When tokenizing a Local/Remote descriptor, mfs_load_property_groups extracts the attacker-controlled property name (bounded only by the message length) and, when no value follows, formats it into a fixed 512-byte error_msg field of the MfsErlDrvData struct using an unchecked sprintf call. Names longer than roughly 452 bytes overflow into the immediately following struct fields (text_buf, text_ptr, term_spec, term_spec_size, term_spec_index), overwriting live pointers and counters with attacker-chosen bytes. Subsequent scanner code writes and frees through the corrupted pointers, producing arbitrary write and arbitrary free primitives inside the BEAM VM process, which can be leveraged for remote code execution. On builds compiled with _FORTIFY_SOURCE the overflow is detected at runtime and terminates the process with SIGABRT, resulting in denial of service.

The overflow occurs in the flex scanner before any grammar or Megaco-level authentication processing, so exploitation requires only network reachability to the megaco transport port on a node configured with {scanner, flex}.

This vulnerability is associated with program files lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src and program routines mfs_load_property_groups.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.15, OTP 28.5.0.4, and OTP 29.0.4, corresponding to megaco from 3.17.1 before 4.7.2.2, 4.8.3.1, and 4.9.1. Whether OTP before OTP 17.0, corresponding to megaco before 3.17.1, is affected is unknown.

Workarounds

Switch the megaco text codec to the default Erlang-based scanner by removing {scanner, flex} from the encoder configuration. The Erlang scanner is not affected by this C-level memory corruption, at the cost of reduced parsing throughput.

Configurations

The megaco text codec must be configured to use the flex scanner via the encoder option {scanner, flex} (the documented high-performance configuration). Deployments using the default Erlang-based scanner are not affected.

NVD (es)

Clásico desbordamiento de búfer en el controlador C del escáner flex megaco de Erlang/OTP permite a un atacante remoto no autenticado corromper la memoria del controlador (y potencialmente lograr la ejecución remota de código o un fallo por denegación de servicio) enviando un único mensaje H.248/Megaco codificado en texto que contiene un nombre de parámetro de propiedad sobredimensionado. Al tokenizar un descriptor Local/Remoto, mfs_load_property_groups extrae el nombre de propiedad controlado por el atacante (limitado solo por la longitud del mensaje) y, cuando no le sigue ningún valor, lo formatea en un campo error_msg fijo de 512 bytes de la estructura MfsErlDrvData utilizando una llamada sprintf sin verificar. Nombres de más de aproximadamente 452 bytes desbordan los campos de la estructura inmediatamente siguientes (text_buf, text_ptr, term_spec, term_spec_size, term_spec_index), sobrescribiendo punteros y contadores activos con bytes elegidos por el atacante. El código del escáner posterior escribe y libera a través de los punteros corruptos, produciendo primitivas de escritura arbitraria y liberación arbitraria dentro del proceso de la VM BEAM, que pueden ser aprovechadas para la ejecución remota de código. En compilaciones con _FORTIFY_SOURCE, el desbordamiento se detecta en tiempo de ejecución y termina el proceso con SIGABRT, lo que resulta en denegación de servicio. El desbordamiento ocurre en el escáner flex antes de cualquier procesamiento de gramática o autenticación a nivel Megaco, por lo que la explotación requiere solo accesibilidad de red al puerto de transporte megaco en un nodo configurado con {scanner, flex}. Esta vulnerabilidad está asociada con los archivos de programa lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src y las rutinas de programa mfs_load_property_groups. Este problema afecta a OTP desde OTP 17.0 antes de OTP 29.0.4, OTP 28.5.0.4 y OTP 27.3.4.15, lo que corresponde a megaco desde 3.17.1 antes de 4.9.1, 4.8.3.1 y 4.7.2.2. Las versiones anteriores a OTP 17.0 también están afectadas, pero no se enumeran porque el esquema de versiones de OTP solo se define a partir de OTP 17.0 en adelante.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-59250 changed 2026-11-20CVE Terms of Use
Erlang Ecosystem FoundationEEF-CVE-2026-59250 changed 2026-11-25CC-BY-4.0
NVDCVE-2026-59250 changed 2026-11-20Public domain