{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "extracted_events": [
              {
                "introduced": "0"
              },
              {
                "fixed": "v1.22.0"
              }
            ],
            "source": "DESCRIPTION"
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "035b8d596a954c2dd4bc40e3fa28a7cb2a8c0ec1"
            }
          ],
          "repo": "https://github.com/debevv/nanomodbus",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "mitre",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/29xxx/CVE-2026-29972.json"
  },
  "details": "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.",
  "id": "CVE-2026-29972",
  "modified": "2026-07-15T01:49:01.527015497Z",
  "published": "2026-05-08T00:00:00Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://gist.github.com/dwilliams27/a4e26fe747c8561d608f7549804bd85f"
    },
    {
      "type": "WEB",
      "url": "https://github.com/debevv/nanoMODBUS/blob/master/nanomodbus.c#L580-L615"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/29xxx/CVE-2026-29972.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-29972"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/debevv/nanoMODBUS"
    }
  ],
  "schema_version": "1.8.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H",
      "type": "CVSS_V3"
    }
  ]
}