{"containers":{"cna":{"affected":[{"cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["megaco_flex_scanner","megaco_flex_scanner_drv"],"packageName":"megaco","packageURL":"pkg:otp/megaco?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%20https:%2F%2Fgithub.com%2Ferlang%2Fotp.git","product":"OTP","programFiles":["src/flex/megaco_flex_scanner_drv.flex.src"],"programRoutines":[{"name":"mfs_load_property_groups"},{"name":"megaco_flex_scanner:scan/2"}],"repo":"https://github.com/erlang/otp","vendor":"Erlang","versions":[{"changes":[{"at":"4.9.1","status":"unaffected"},{"at":"4.8.3.1","status":"unaffected"},{"at":"4.7.2.2","status":"unaffected"}],"lessThan":"*","status":"affected","version":"3.17.1","versionType":"otp"}]},{"collectionURL":"https://github.com","cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","modules":["megaco_flex_scanner","megaco_flex_scanner_drv"],"packageName":"erlang/otp","packageURL":"pkg:github/erlang/otp","product":"OTP","programFiles":["lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src"],"programRoutines":[{"name":"mfs_load_property_groups"},{"name":"megaco_flex_scanner:scan/2"}],"repo":"https://github.com/erlang/otp","vendor":"Erlang","versions":[{"changes":[{"at":"29.0.4","status":"unaffected"},{"at":"28.5.0.4","status":"unaffected"},{"at":"27.3.4.15","status":"unaffected"}],"lessThan":"*","status":"affected","version":"R13B03","versionType":"otp"},{"lessThan":"8704c8f550a11ed5f825e3c011ecb03565b79c4f","status":"affected","version":"84adefa331c4159d432d22840663c38f155cd4c1","versionType":"git"}]}],"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>The megaco text codec must be configured to use the flex scanner via the encoder option <tt>{scanner, flex}</tt> (the documented high-performance configuration). Deployments using the default Erlang-based scanner are not affected.</p>"}],"value":"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."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"27.3.4.15","vulnerable":true},{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"28.5.0.4","versionStartIncluding":"28.0","vulnerable":true},{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"29.0.4","versionStartIncluding":"29.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"remediation developer","value":"Jakub Witczak"},{"lang":"en","type":"remediation reviewer","value":"Micael Karlberg"}],"descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>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.</p><p>When tokenizing a Local/Remote descriptor, <tt>mfs_load_property_groups</tt> extracts the attacker-controlled property name (bounded only by the message length) and, when no value follows, formats it into a fixed 512-byte <tt>error_msg</tt> field of the <tt>MfsErlDrvData</tt> struct using an unchecked <tt>sprintf</tt> call. Names longer than roughly 452 bytes overflow into the immediately following struct fields (<tt>text_buf</tt>, <tt>text_ptr</tt>, <tt>term_spec</tt>, <tt>term_spec_size</tt>, <tt>term_spec_index</tt>), 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 <tt>_FORTIFY_SOURCE</tt> the overflow is detected at runtime and terminates the process with <tt>SIGABRT</tt>, resulting in denial of service.</p><p>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 <tt>{scanner, flex}</tt>.</p><p>This vulnerability is associated with program files <tt>lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src</tt> and program routines <tt>mfs_load_property_groups</tt>.</p><p>This issue affects OTP from OTP 17.0 before OTP&nbsp;29.0.4, OTP&nbsp;28.5.0.4 and OTP&nbsp;27.3.4.15, corresponding to megaco from 3.17.1 before 4.9.1, 4.8.3.1 and 4.7.2.2. Versions prior to OTP 17.0 are also affected but are not listed because the OTP version scheme is only defined from OTP 17.0 onwards.</p>"}],"value":"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 29.0.4, OTP 28.5.0.4 and OTP 27.3.4.15, corresponding to megaco from 3.17.1 before 4.9.1, 4.8.3.1 and 4.7.2.2. Versions prior to OTP 17.0 are also affected but are not listed because the OTP version scheme is only defined from OTP 17.0 onwards."}],"impacts":[{"capecId":"CAPEC-100","descriptions":[{"lang":"en","value":"CAPEC-100 Overflow Buffers"}]}],"metrics":[{"cvssV4_0":{"attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":8.3,"baseSeverity":"HIGH","privilegesRequired":"NONE","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-120","description":"CWE-120 Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')","lang":"en","type":"CWE"},{"cweId":"CWE-787","description":"CWE-787 Out-of-bounds Write","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-07-27T16:11:30.159Z","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","shortName":"EEF"},"references":[{"tags":["vendor-advisory","related"],"url":"https://github.com/erlang/otp/security/advisories/GHSA-7xgh-gmgf-q2g7"},{"tags":["related"],"url":"https://cna.erlef.org/cves/CVE-2026-59250.html"},{"tags":["related"],"url":"https://osv.dev/vulnerability/EEF-CVE-2026-59250"},{"tags":["x_version-scheme"],"url":"https://www.erlang.org/doc/system/versions.html#order-of-versions"},{"tags":["patch"],"url":"https://github.com/erlang/otp/commit/8704c8f550a11ed5f825e3c011ecb03565b79c4f"}],"source":{"discovery":"INTERNAL"},"title":"Megaco flex scanner buffer overflow via oversized property parm name","workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"<p>Switch the megaco text codec to the default Erlang-based scanner by removing <tt>{scanner, flex}</tt> from the encoder configuration. The Erlang scanner is not affected by this C-level memory corruption, at the cost of reduced parsing throughput.</p>"}],"value":"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."}],"x_generator":{"engine":"cvelib 1.8.0"}}},"cveMetadata":{"assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","assignerShortName":"EEF","cveId":"CVE-2026-59250","datePublished":"2026-07-27T15:25:03.106Z","dateReserved":"2026-07-04T04:24:03.653Z","dateUpdated":"2026-07-27T16:11:30.159Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"}