{"id":"CVE-2026-59250","aliases":["CVE-2026-59250","EEF-CVE-2026-59250","GHSA-7xgh-gmgf-q2g7"],"related":[],"kind":"vulnerability","state":"published","title":"Megaco flex scanner buffer overflow via oversized property parm name","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.\n\nWhen 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.\n\nThe 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}.\n\nThis vulnerability is associated with program files lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src and program routines mfs_load_property_groups.\n\nThis 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.\n\nWhen 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.\n\nThe 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}.\n\nThis vulnerability is associated with program files lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src and program routines mfs_load_property_groups.\n\nThis 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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nClassic 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.\n\nWhen 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.\n\nThe 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}`.\n\nThis vulnerability is associated with program files `lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src` and program routines `mfs_load_property_groups`.\n\nThis 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.\n\n## Workarounds\n\nSwitch 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.\n\n## Configurations\n\nThe 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.","format":"markdown","source":"eef"},{"lang":"es","text":"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.\n\nAl 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.\n\nEl 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}.\n\nEsta 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.\n\nEste 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.","source":"nvd"}],"published":"2026-07-27T15:25:03.106Z","modified":"2026-11-25T06:30:09.976Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N","score":8.3,"rating":"HIGH"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N","score":8.3,"rating":"HIGH"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N"}],"cwes":["CWE-120","CWE-787"],"affected":[{"ranges":[{"type":"otp","introduced":"3.17.1","fixed":"*","status":"affected"}],"vendor":"Erlang","product":"OTP","package":"megaco","cpe":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","repo":"https://github.com/erlang/otp","source":"cvelist"},{"ranges":[{"type":"otp","introduced":"17.0","fixed":"*","status":"affected"}],"vendor":"Erlang","product":"OTP","package":"otp","cpe":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"git","introduced":"84adefa331c4159d432d22840663c38f155cd4c1","fixed":"8704c8f550a11ed5f825e3c011ecb03565b79c4f","status":"affected"},{"type":"git","introduced":"8704c8f550a11ed5f825e3c011ecb03565b79c4f","fixed":"*","status":"unaffected"}],"vendor":"Erlang","product":"OTP","package":"erlang/otp","cpe":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","repo":"https://github.com/erlang/otp","source":"cvelist"},{"ranges":[{"type":"git","introduced":"84adefa331c4159d432d22840663c38f155cd4c1","status":"affected","fixed":"8704c8f550a11ed5f825e3c011ecb03565b79c4f"}],"repo":"https://github.com/erlang/otp","source":"eef"}],"references":[{"url":"https://github.com/erlang/otp/security/advisories/GHSA-7xgh-gmgf-q2g7","tags":["advisory","related","vendor-advisory"],"sources":["cvelist","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-59250.html","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-59250","tags":["related"],"sources":["cvelist","nvd"]},{"url":"https://www.erlang.org/doc/system/versions.html#order-of-versions","tags":["web","x-version-scheme"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/erlang/otp/commit/8704c8f550a11ed5f825e3c011ecb03565b79c4f","tags":["fix","patch"],"sources":["cvelist","eef","nvd"]}],"credits":["Jonatan Männchen / EEF","Jakub Witczak","Micael Karlberg"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-27T18:33:04.735Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59250","url":"https://www.cve.org/CVERecord?id=CVE-2026-59250","licence":"CVE Terms of Use","modified":"2026-11-20T06:05:34.831Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-59250","url":"https://osv.dev/vulnerability/EEF-CVE-2026-59250","licence":"CC-BY-4.0","modified":"2026-11-25T06:30:09.976Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59250","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59250","licence":"Public domain","modified":"2026-11-20T06:17:33.807Z"}],"updatedAt":"2026-11-25T22:59:30.211Z","epss":{"score":0.00954,"percentile":0.62392,"date":"2026-12-01T12:00:22.000Z"}}