CVE-2026-16668 (GCVE-0-2026-16668)

Vulnerability from cvelistv5 – Published: 2026-11-24 22:39 – Updated: 2026-11-24 23:13
VLAI
Title
Unbounded CBOR recursion in MCUboot serial recovery allows pre-authentication stack exhaustion
Summary
The vendored zcbor decoder's zcbor_any_skip() in boot/zcbor/src/zcbor_decode.c descends one C-stack frame per level of CBOR nesting. On a list or map it copies the decoder state (memcpy(&state_copy, state, sizeof(zcbor_state_t))) and recurses once per member, with no depth cap: the skip path does not use zcbor's backup stack, and ZCBOR_MAX_ELEM_COUNT is SIZE_MAX, so nothing bounds how deep the recursion goes. That function is reached on attacker-controlled bytes before any authentication. MCUboot's serial-recovery command parser decodes SMP/CBOR requests with zcbor_map_decode_bulk() (boot/boot_serial/src/zcbor_bulk.c), which skips any map key it does not recognise by calling zcbor_any_skip() on the encoded value; the echo handler in boot/boot_serial/src/boot_serial.c calls it directly on the same footing. Both run during image upload, long before the uploaded image's signature is checked. The default receive buffer is MCUBOOT_SERIAL_MAX_RECEIVE_SIZE = 512 bytes and each nesting level costs a single byte to encode (0x81), so roughly 500 levels of nesting fit in one request — comfortably more than a bootloader's stack can absorb, since every frame carries a full zcbor_state_t copy plus locals. The impact is availability only: the bootloader's stack overflows and the device faults or hangs during recovery. There is no controlled out-of-bounds write that escapes the DFU buffer, no disclosure, and no authentication bypass — the recursion grows the stack with the decoder's own internal state. Whether a given board actually exhausts its stack depends on that board's bootloader stack size, which we did not measure; the fix is nevertheless unconditional, because an unauthenticated pre-authentication code path must not have its safety depend on a per-board stack margin. Exposure requires MCUBOOT_SERIAL (serial/SMP recovery), which is not enabled by default, and recovery entry is normally gated on a physical pin (CONFIG_BOOT_SERIAL_ENTRANCE_GPIO / PIN_RESET), with a no-valid-image fallback path. Products that expose serial recovery over an externally reachable transport, or that fall into recovery when no valid image is present, are the ones at risk. The fix is to bound the skip: thread a recursion-depth counter through zcbor_any_skip() (or have zcbor_map_decode_bulk() reject values nested beyond a small constant) and fail once the limit is exceeded — equivalently, take the bounded-skip implementation from upstream zcbor.
CWE
Impacted products
Vendor Product Version
mcu-tools mcuboot Affected: 2.0.0 , < 2.5.1 (semver)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "collectionURL": "https://github.com/mcu-tools/mcuboot",
          "defaultStatus": "unaffected",
          "packageName": "mcuboot",
          "product": "mcuboot",
          "programFiles": [
            "boot/boot_serial/src/boot_serial.c",
            "boot/boot_serial/src/zcbor_bulk.c",
            "boot/zcbor/src/zcbor_decode.c"
          ],
          "programRoutines": [
            {
              "name": "bs_echo"
            },
            {
              "name": "zcbor_any_skip"
            },
            {
              "name": "zcbor_map_decode_bulk"
            }
          ],
          "vendor": "mcu-tools",
          "versions": [
            {
              "lessThan": "2.5.1",
              "status": "affected",
              "version": "2.0.0",
              "versionType": "semver"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "finder",
          "value": "NVIDIA - Project Vanessa"
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "The vendored zcbor decoder\u0027s zcbor_any_skip() in boot/zcbor/src/zcbor_decode.c descends one C-stack frame per level of CBOR nesting. On a list or map it copies the decoder state (memcpy(\u0026state_copy, state, sizeof(zcbor_state_t))) and recurses once per member, with no depth cap: the skip path does not use zcbor\u0027s backup stack, and ZCBOR_MAX_ELEM_COUNT is SIZE_MAX, so nothing bounds how deep the recursion goes.\n\nThat function is reached on attacker-controlled bytes before any authentication. MCUboot\u0027s serial-recovery command parser decodes SMP/CBOR requests with zcbor_map_decode_bulk() (boot/boot_serial/src/zcbor_bulk.c), which skips any map key it does not recognise by calling zcbor_any_skip() on the encoded value; the echo handler in boot/boot_serial/src/boot_serial.c calls it directly on the same footing. Both run during image upload, long before the uploaded image\u0027s signature is checked. The default receive buffer is MCUBOOT_SERIAL_MAX_RECEIVE_SIZE = 512 bytes and each nesting level costs a single byte to encode (0x81), so roughly 500 levels of nesting fit in one request \u2014 comfortably more than a bootloader\u0027s stack can absorb, since every frame carries a full zcbor_state_t copy plus locals.\n\nThe impact is availability only: the bootloader\u0027s stack overflows and the device faults or hangs during recovery. There is no controlled out-of-bounds write that escapes the DFU buffer, no disclosure, and no authentication bypass \u2014 the recursion grows the stack with the decoder\u0027s own internal state. Whether a given board actually exhausts its stack depends on that board\u0027s bootloader stack size, which we did not measure; the fix is nevertheless unconditional, because an unauthenticated pre-authentication code path must not have its safety depend on a per-board stack margin.\n\nExposure requires MCUBOOT_SERIAL (serial/SMP recovery), which is not enabled by default, and recovery entry is normally gated on a physical pin (CONFIG_BOOT_SERIAL_ENTRANCE_GPIO / PIN_RESET), with a no-valid-image fallback path. Products that expose serial recovery over an externally reachable transport, or that fall into recovery when no valid image is present, are the ones at risk.\n\nThe fix is to bound the skip: thread a recursion-depth counter through zcbor_any_skip() (or have zcbor_map_decode_bulk() reject values nested beyond a small constant) and fail once the limit is exceeded \u2014 equivalently, take the bounded-skip implementation from upstream zcbor."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 2.4,
            "baseSeverity": "LOW",
            "vectorString": "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
            "version": "3.1"
          },
          "format": "CVSS"
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-674",
              "description": "dos",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-11-24T23:13:21.927Z",
        "orgId": "e2e69745-5e70-4e92-8431-deb5529a81ad",
        "shortName": "zephyr"
      },
      "references": [
        {
          "name": "Fix commit",
          "tags": [
            "patch"
          ],
          "url": "https://github.com/mcu-tools/mcuboot/commit/1b9d870bad5ee45419824fe038ada8901d873749"
        },
        {
          "name": "GHSA-jchr-4hhc-j9gj",
          "url": "https://github.com/mcu-tools/mcuboot/security/advisories/GHSA-jchr-4hhc-j9gj"
        }
      ],
      "title": "Unbounded CBOR recursion in MCUboot serial recovery allows pre-authentication stack exhaustion",
      "x_generator": {
        "engine": "cvelib 1.8.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "e2e69745-5e70-4e92-8431-deb5529a81ad",
    "assignerShortName": "zephyr",
    "cveId": "CVE-2026-16668",
    "datePublished": "2026-11-24T22:39:47.978Z",
    "dateReserved": "2026-07-22T19:47:59.724Z",
    "dateUpdated": "2026-11-24T23:13:21.927Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2026-16668",
      "date": "2026-11-25",
      "epss": "0.00612",
      "percentile": "0.43493"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "collectionURL": "https://github.com/mcu-tools/mcuboot",
                "defaultStatus": "unaffected",
                "packageName": "mcuboot",
                "product": "mcuboot",
                "programFiles": [
                  "boot/boot_serial/src/boot_serial.c",
                  "boot/boot_serial/src/zcbor_bulk.c",
                  "boot/zcbor/src/zcbor_decode.c"
                ],
                "programRoutines": [
                  {
                    "name": "bs_echo"
                  },
                  {
                    "name": "zcbor_any_skip"
                  },
                  {
                    "name": "zcbor_map_decode_bulk"
                  }
                ],
                "vendor": "mcu-tools",
                "versions": [
                  {
                    "lessThan": "2.5.1",
                    "status": "affected",
                    "version": "2.0.0",
                    "versionType": "semver"
                  }
                ]
              }
            ],
            "source": "vulnerabilities@zephyrproject.org"
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "The vendored zcbor decoder\u0027s zcbor_any_skip() in boot/zcbor/src/zcbor_decode.c descends one C-stack frame per level of CBOR nesting. On a list or map it copies the decoder state (memcpy(\u0026state_copy, state, sizeof(zcbor_state_t))) and recurses once per member, with no depth cap: the skip path does not use zcbor\u0027s backup stack, and ZCBOR_MAX_ELEM_COUNT is SIZE_MAX, so nothing bounds how deep the recursion goes.\n\nThat function is reached on attacker-controlled bytes before any authentication. MCUboot\u0027s serial-recovery command parser decodes SMP/CBOR requests with zcbor_map_decode_bulk() (boot/boot_serial/src/zcbor_bulk.c), which skips any map key it does not recognise by calling zcbor_any_skip() on the encoded value; the echo handler in boot/boot_serial/src/boot_serial.c calls it directly on the same footing. Both run during image upload, long before the uploaded image\u0027s signature is checked. The default receive buffer is MCUBOOT_SERIAL_MAX_RECEIVE_SIZE = 512 bytes and each nesting level costs a single byte to encode (0x81), so roughly 500 levels of nesting fit in one request \u2014 comfortably more than a bootloader\u0027s stack can absorb, since every frame carries a full zcbor_state_t copy plus locals.\n\nThe impact is availability only: the bootloader\u0027s stack overflows and the device faults or hangs during recovery. There is no controlled out-of-bounds write that escapes the DFU buffer, no disclosure, and no authentication bypass \u2014 the recursion grows the stack with the decoder\u0027s own internal state. Whether a given board actually exhausts its stack depends on that board\u0027s bootloader stack size, which we did not measure; the fix is nevertheless unconditional, because an unauthenticated pre-authentication code path must not have its safety depend on a per-board stack margin.\n\nExposure requires MCUBOOT_SERIAL (serial/SMP recovery), which is not enabled by default, and recovery entry is normally gated on a physical pin (CONFIG_BOOT_SERIAL_ENTRANCE_GPIO / PIN_RESET), with a no-valid-image fallback path. Products that expose serial recovery over an externally reachable transport, or that fall into recovery when no valid image is present, are the ones at risk.\n\nThe fix is to bound the skip: thread a recursion-depth counter through zcbor_any_skip() (or have zcbor_map_decode_bulk() reject values nested beyond a small constant) and fail once the limit is exceeded \u2014 equivalently, take the bounded-skip implementation from upstream zcbor."
          }
        ],
        "id": "CVE-2026-16668",
        "lastModified": "2026-11-24T23:17:32.420",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "PHYSICAL",
                "availabilityImpact": "LOW",
                "baseScore": 2.4,
                "baseSeverity": "LOW",
                "confidentialityImpact": "NONE",
                "integrityImpact": "NONE",
                "privilegesRequired": "NONE",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
                "version": "3.1"
              },
              "exploitabilityScore": 0.9,
              "impactScore": 1.4,
              "source": "vulnerabilities@zephyrproject.org",
              "type": "Secondary"
            }
          ]
        },
        "published": "2026-11-24T23:17:32.420",
        "references": [
          {
            "source": "vulnerabilities@zephyrproject.org",
            "url": "https://github.com/mcu-tools/mcuboot/commit/1b9d870bad5ee45419824fe038ada8901d873749"
          },
          {
            "source": "vulnerabilities@zephyrproject.org",
            "url": "https://github.com/mcu-tools/mcuboot/security/advisories/GHSA-jchr-4hhc-j9gj"
          }
        ],
        "sourceIdentifier": "vulnerabilities@zephyrproject.org",
        "vulnStatus": "Received",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-674"
              }
            ],
            "source": "vulnerabilities@zephyrproject.org",
            "type": "Secondary"
          }
        ]
      }
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…