{"id":"CVE-2026-29972","aliases":["CVE-2026-29972"],"related":[],"kind":"vulnerability","state":"published","title":"nanoMODBUS through v1.22.0 has a stack-based buffer overflow in recvreadregistersres() in nanomodbus.c.","summary":"nanoMODBUS through v1.22.0 has a stack-based buffer overflow in recv_read_registers_res() in nanomodbus.c. When a client calls nmbs_read_holding_registers() or nmbs_read_input_registers(), the library writes register data from the server response to the caller-provided buffer based on the response's byte_count field before validating that byte_count matches the requested quantity. A malicious Modbus TCP server can send a response with byte_count=250 (125 registers) regardless of the requested quantity, causing up to 248 bytes of attacker-controlled data to overflow the buffer, potentially allowing remote code execution.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"nanoMODBUS through v1.22.0 has a stack-based buffer overflow in recv_read_registers_res() in nanomodbus.c. When a client calls nmbs_read_holding_registers() or nmbs_read_input_registers(), the library writes register data from the server response to the caller-provided buffer based on the response's byte_count field before validating that byte_count matches the requested quantity. A malicious Modbus TCP server can send a response with byte_count=250 (125 registers) regardless of the requested quantity, causing up to 248 bytes of attacker-controlled data to overflow the buffer, potentially allowing remote code execution.","source":"cvelist"}],"published":"2026-05-08T00:00:00.000Z","modified":"2026-06-17T10:29:58.400Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H","score":8.2,"rating":"HIGH"}],"cwes":["CWE-121"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"}],"references":[{"url":"https://github.com/debevv/nanoMODBUS","tags":[],"sources":["cvelist","nvd"]},{"url":"https://github.com/debevv/nanoMODBUS/blob/master/nanomodbus.c#L580-L615","tags":[],"sources":["cvelist","nvd"]},{"url":"https://gist.github.com/dwilliams27/a4e26fe747c8561d608f7549804bd85f","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-05-08T15:58:34.041Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-29972","url":"https://www.cve.org/CVERecord?id=CVE-2026-29972","licence":"CVE Terms of Use","modified":"2026-05-08T15:59:03.619Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-29972","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-29972","licence":"Public domain","modified":"2026-06-17T10:29:58.400Z"}],"updatedAt":"2026-11-25T22:59:21.092Z","epss":{"score":0.00639,"percentile":0.51934,"date":"2026-12-01T12:00:22.000Z"}}