Skip to content

Bluetooth: Mesh: Out-of-Bound Write in gen_prov_start

High
ceolin published GHSA-8wvr-688x-68vr Nov 26, 2025

Package

zephyr (zephyr)

Affected versions

<= 4.2

Patched versions

None

Description

There is a potential OOB Write vulnerability in the
gen_prov_start function in pb_adv.c. The full length of the received
data is copied into the link.rx.buf receiver buffer in line 673
without any validation on the data size.

Technical Details

  1. There is a memcpy on line 673 that copies data into link.rx.buf->data buffer.
  2. There is no validation on the length of the received data buf->len.
  3. There seems to be a check on line 631. However, link.rx.buf->len is read from the packet
    (in line 618) and may not correspond to the actual length of the packet in buf->len.
  4. Hence, if the source buffer has a length greater than that of the receiver buffer, a
    malicious packet can write out of bounds in this function.

Potential Impact

An out-of-bound write can lead to an arbitrary code execution. This is more severe in real-time
operating systems like Zephyr that run in embedded devices without common memory
protection systems. Even on devices with some form of memory protection, this can still lead to
a crash and a resultant denial of service.

Recommended Fix

We recommend that the validation on line 631 should be updated so it validates that the
buf->len field is not greater than the receiver buffer size.

Patches

main: #95064
4.2: #97520
4.1: #97519

For more information

If you have any questions or comments about this advisory:

embargo: 2025-11-24

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Adjacent
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H

CVE ID

CVE-2025-9558

Weaknesses

Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. Learn more on MITRE.

Credits