Skip to content

Out-of-bounds read in coredump shell when printing stored-dump target code

Low
d3zd3z published GHSA-9fw2-4429-49q8 Jul 29, 2026

Software

zephyr

Affected versions

>= 4.2.0, < 4.3.1
>= 4.4.0, <= 4.4.1

Patched versions

4.3.1
4.5.0

Description

In subsys/debug/coredump/coredump_shell.c, print_coredump_hdr() used the 16-bit tgt_code field of a stored Zephyr coredump header directly as an index into coredump_target_code2str[], a fixed 7-element array of string pointers, with no bounds check.

A stored coredump whose tgt_code is >= 7 causes an out-of-bounds read of a char* up to ~64K entries past the array; that value is passed as the %s argument to shell_print, which dereferences and walks it as a string. The result is either disclosure of device memory contents to the shell user or a crash when the out-of-bounds pointer is unmapped.

The defect is reached via the coredump print shell command (cmd_coredump_print_stored_dump -> pretty_print_coredump -> parse_and_print_coredump -> print_coredump_hdr). The tgt_code field is device-generated and in-range during normal crash handling, so triggering requires local shell access plus the ability to stage or corrupt the stored coredump in the flash/in-memory backend.

Introduced in v4.2.0 (commit 13abd7f) and present through v4.4.0; fixed by clamping out-of-range codes to the 'unknown' (index 0) entry.

Affected components

  • subsys/debug/coredump

Affected versions

v4.2.0, v4.2.1, v4.2.2, v4.3.0, v4.4.0

Fix

Fixed (merged) in a922632

Projected fixed version: 4.5.0 (the fix is merged on main but not yet released; this forecast should be confirmed against the actual release).

Introduced by: 13abd7f ("coredump: Generalize the shell module", v4.2.0)

Evidence

  • subsys/debug/coredump/coredump_shell.c:44-52 — coredump_target_code2str has exactly 7 entries
  • subsys/debug/coredump/coredump_shell.c (pre-fix, a922632^:185-211) — tgt_code used directly as array index with no bounds check, result passed to shell_print %s
  • include/zephyr/debug/coredump.h:179 — tgt_code is a 16-bit field of __packed coredump_hdr_t, so index can reach 65535
  • subsys/debug/coredump/coredump_shell.c:202-210 — post-fix clamp: index >= ARRAY_SIZE -> 0, closing the OOB read
  • subsys/debug/coredump/coredump_shell.c:528-567 — reach: cmd_coredump_print_stored_dump -> pretty_print_coredump -> parse_and_print_coredump -> print_coredump_hdr (shell-gated)
  • subsys/debug/coredump/coredump_core.c:83 — header is normally written by the device with a valid arch tgt_code (in-range under normal use)
  • git tag --contains 13abd7f — vulnerable code shipped in v4.2.0..v4.4.0

Patches

Branch Pull request Status
main #109630 merged
v4.4-branch #111421 merged
v4.3-branch #111422 merged

For more information

If you have any questions or comments about this advisory:

embargo: 2026-07-28

Severity

Low

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
Local
Attack complexity
High
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
Low

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:L/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:L

CVE ID

CVE-2026-10684

Weaknesses

Out-of-bounds Read

The product reads data past the end, or before the beginning, of the intended buffer. Learn more on MITRE.