---
id: CVE-2026-57842
title: >-
  NetBSD contains a use-after-free and double-free vulnerability in
  msg_recv_copyin() within the COMPAT_NETBSD32 compatibility layer due to a
  missing return statement before the cleanup label on the success path
summary: >-
  NetBSD contains a use-after-free and double-free vulnerability in
  msg_recv_copyin() within the COMPAT_NETBSD32 compatibility layer due to a
  missing return statement before the cleanup label on the success path. Any
  local user able to exe…
severity: high
cvss: 7
cvssVector: 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'
cwe:
  - CWE-415
  - CWE-416
vendor: The NetBSD Foundation
product: NetBSD
affected:
  - NetBSD >= 8.0 <= 8.3
  - NetBSD >= 9.0 < 9.5
  - NetBSD >= 10.0 <= 10.1
published: '2026-09-11'
updated: '2026-09-24'
sourceUpdated: '2026-09-24T20:44:42.207'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-57842'
references:
  - url: 'https://gnats.netbsd.org/60373'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/netbsd-compat-netbsd32-double-free-use-after-free-via-recvmsg-msg-iovlen
    label: disclosure@vulncheck.com
tags:
  - nvd
  - cve.org
epss: 0.00135
epssPercentile: 0.0243
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-09-11T14:56:09.344902Z'
ingestedAt: '2026-09-11T17:50:33.555Z'
---

## Overview

NetBSD contains a use-after-free and double-free vulnerability in msg_recv_copyin() within the COMPAT_NETBSD32 compatibility layer due to a missing return statement before the cleanup label on the success path. Any local user able to execute a 32-bit binary on a 64-bit NetBSD system can trigger a kernel panic or memory corruption by calling recvmsg() with msg_iovlen between 9 and IOV_MAX, causing the kernel to access a freed iovec buffer and subsequently free the same allocation a second time.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
