{"id":"CVE-2026-54410","state":"PUBLISHED","title":"nanoMODBUS Off-by-One Buffer Overflow in recv_msg_header() via Crafted MBAP Length Field","description":"nanoMODBUS through v1.23.0 contains an off-by-one buffer overflow in the recv_msg_header function of the Modbus/TCP server that allows remote unauthenticated attackers to write one attacker-controlled byte past the end of the 260-byte receive buffer by sending a crafted MBAP frame whose Length field is set to 255.","publishedAt":"2026-06-14T17:10:12.275Z","updatedAt":"2026-08-10T11:43:54.292Z","severity":{"score":7.8,"label":"High","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N/E:P/AU:Y","source":"TuranSec"},"assigner":"TuranSec","products":["debevv nanoMODBUS"],"affected":[{"vendor":"debevv","product":"nanoMODBUS","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThanOrEqual":"1.23.0","versionType":"semver"}],"collectionURL":"https://github.com/debevv/nanoMODBUS","repo":"https://github.com/debevv/nanoMODBUS","programFiles":["nanomodbus.c"],"programRoutines":[{"name":"recv_msg_header"}]}],"references":["https://github.com/debevv/nanoMODBUS","https://github.com/debevv/nanoMODBUS/blob/v1.23.0/nanomodbus.c#L369","https://cwe.mitre.org/data/definitions/193.html","https://cwe.mitre.org/data/definitions/787.html"],"weaknesses":["CWE-193","CWE-787"],"ingestedAt":"2026-10-29T20:12:24.861Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/54xxx/CVE-2026-54410.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-54410","state":"PUBLISHED","datePublished":"2026-06-14T17:10:12.275Z","dateUpdated":"2026-08-10T11:43:54.292Z","assignerShortName":"TuranSec","assignerOrgId":"309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c","dateReserved":"2026-06-13T16:39:46.122Z"},"containers":{"cna":{"title":"nanoMODBUS Off-by-One Buffer Overflow in recv_msg_header() via Crafted MBAP Length Field","descriptions":[{"lang":"en","value":"nanoMODBUS through v1.23.0 contains an off-by-one buffer overflow in the recv_msg_header function of the Modbus/TCP server that allows remote unauthenticated attackers to write one attacker-controlled byte past the end of the 260-byte receive buffer by sending a crafted MBAP frame whose Length field is set to 255."}],"affected":[{"vendor":"debevv","product":"nanoMODBUS","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThanOrEqual":"1.23.0","versionType":"semver"}],"collectionURL":"https://github.com/debevv/nanoMODBUS","repo":"https://github.com/debevv/nanoMODBUS","programFiles":["nanomodbus.c"],"programRoutines":[{"name":"recv_msg_header"}]}],"references":[{"url":"https://github.com/debevv/nanoMODBUS","name":"nanoMODBUS - upstream repository (vendor)","tags":["product"]},{"url":"https://github.com/debevv/nanoMODBUS/blob/v1.23.0/nanomodbus.c#L369","name":"Vulnerable bounds check at nanomodbus.c line 369 (v1.23.0)","tags":["product"]},{"url":"https://cwe.mitre.org/data/definitions/193.html","name":"CWE-193: Off-by-one Error","tags":["technical-description"]},{"url":"https://cwe.mitre.org/data/definitions/787.html","name":"CWE-787: Out-of-bounds Write","tags":["technical-description"]}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"An attacker who can reach the TCP listening port of a Modbus/TCP server built on nanoMODBUS (typically TCP/502 on industrial / OT networks) sends a single crafted MBAP frame with Length=255 to corrupt the buf_idx field of the nmbs_t struct, causing denial of service or, on memory-protection-less embedded targets, additional information disclosure or unintended register writes."}],"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"LOW","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subAvailabilityImpact":"NONE","exploitMaturity":"PROOF_OF_CONCEPT","Safety":"NOT_DEFINED","Automatable":"YES","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED","version":"4.0","baseSeverity":"HIGH","baseScore":7.8,"vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N/E:P/AU:Y"}},{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV3_1":{"version":"3.1","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"LOW","integrityImpact":"LOW","availabilityImpact":"HIGH","baseSeverity":"HIGH","baseScore":8.6,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H"}},{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV2_0":{"version":"2.0","accessVector":"NETWORK","accessComplexity":"LOW","authentication":"NONE","confidentialityImpact":"PARTIAL","integrityImpact":"PARTIAL","availabilityImpact":"COMPLETE","baseScore":9,"vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:C"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-193","lang":"en","description":"CWE-193 Off-by-one Error","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-787","lang":"en","description":"CWE-787 Out-of-bounds Write","type":"CWE"}]}],"providerMetadata":{"shortName":"TuranSec","orgId":"309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c","dateUpdated":"2026-08-10T11:43:54.292Z"},"impacts":[{"descriptions":[{"lang":"en","value":"A remote unauthenticated attacker who can reach a Modbus/TCP server built on nanoMODBUS can send a crafted MBAP frame with the Length field set to 255 to overflow the 260-byte receive buffer by one byte, corrupting the adjacent buf_idx field of the nmbs_t struct with an attacker-controlled value. This yields denial of service (subsequent handler calls treat the corrupted buf_idx as a register count / offset and crash, hang, or return invalid data), one-byte information disclosure on bare-metal and RTOS targets without memory protection (ARM Cortex-M, ESP32, STM32 class), and the possibility of writing to unintended register addresses on the FC16 (Write Multiple Registers) handler path. No authentication, no user interaction, and no special configuration are required."}]}],"credits":[{"lang":"en","value":"Burxonov Muslimbek","type":"finder"}],"source":{"discovery":"EXTERNAL"},"x_author":"Burxonov Muslimbek","x_assigner_notes":"Vendor 'debevv' is a single-maintainer GitHub account; nanoMODBUS is MIT-licensed. The vulnerable bounds check was verified by source inspection of v1.22.0, v1.22.1, and v1.23.0 (latest at publish time) - the issue is present in all three; affected range is therefore 0 through v1.23.0 (inclusive) with defaultStatus 'unknown' pending vendor confirmation of a fixed release. CVSS scoring follows the submitter's CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H = 8.6) and translates to 4.0 with VC:L/VI:L/VA:H, SC/SI/SA:N (= 8.7) and 2.0 with C:P/I:P/A:C (= 9.0).","datePublic":"2026-06-14T17:10:12.275Z"},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-06-15T17:00:11.456275Z","id":"CVE-2026-54410","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-06-15T17:05:25.499Z"}}]}}}