---
id: "CVE-2026-62958"
kind: "vulnerability"
aliases: ["CVE-2026-62958"]
title: "libriscv: crafted ELF file can read host memory and crash emulator"
severity: "high"
cvss: 7.9
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["emulator-embedders", "libriscv", "package", "risc-v"]
not_affected_if: ["libriscv-1.18-or-later", "trusted-binaries-only"]
published_at: "2026-10-30T21:17:14+00:00"
first_seen_at: "2026-10-30T21:25:53+00:00"
updated_at: "2026-10-30T21:26:40+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-62958", "first_seen_at": "2026-10-30T21:25:53+00:00"}]
---

# libriscv: crafted ELF file can read host memory and crash emulator

libriscv is a RISC-V sandbox and emulator library. A crafted ELF binary with malformed section headers can make the host emulator read past its input buffer, crashing the process and possibly exposing host heap memory to the guest program.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the libriscv version your project pins, for example in the dependency manifest or lockfile.
- Look for any place your code loads untrusted ELF binaries into libriscv.

## Fix

- libriscv: upgrade to `1.18` or later.

## Timeline

- 2026-10-30T21:25:53+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-62958

## From the sources

libriscv is a RISC-V sandbox and emulator. Prior to 1.18, a crafted ELF binary can cause out-of-bounds reads in the host emulator. `Memory<W>::binary_loader` checks `PT_LOAD` program-header bounds, but `Memory<W>::serialize_execute_segment` trusts section-header `sh_offset` and `sh_size` when locating `.text` without verifying the file range against `m_binary.size()`; `Memory<W>::lookup()` has a similar section-table problem. Malformed `.text` or `.symtab` offsets can therefore bypass the program-header checks and point outside the binary buffer, crashing rvlinux. With suitable memory layout or integer overflow, out-of-buffer host heap memory may instead be mapped into the guest by `create_execute_segment()`, potentially exposing host memory. The reported reproducer demonstrates a host SIGSEGV, while memory disclosure through grooming is described as possible rather than demonstrated. This issue is fixed in version 1.18.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
