Home / mailingsPDF  

FreeBSD Security Advisory FreeBSD-SA-26:52.if_wg

Posted on 30 July 2026
FreeBSD security notificat

=============================================================================FreeBSD-SA-26:52.if_wg Security Advisory
The FreeBSD Project

Topic: Missing MAC validation in wg(4) packet decryption

Category: core
Module: if_wg
Announced: 2026-07-29
Credits: Reo Shiseki
Affects: All supported versions of FreeBSD.
Corrected: 2026-07-29 17:48:41 UTC (stable/15, 15.1-STABLE)
2026-07-29 17:50:34 UTC (releng/15.1, 15.1-RELEASE-p2)
2026-07-29 17:50:08 UTC (releng/15.0, 15.0-RELEASE-p12)
2026-07-29 17:49:02 UTC (stable/14, 14.4-STABLE)
2026-07-29 17:49:36 UTC (releng/14.4, 14.4-RELEASE-p8)
CVE Name: CVE-2026-58085

For general information regarding FreeBSD Security Advisories, including
descriptions of the fields above, security branches, and the following
sections, please visit <URL:https://security.FreeBSD.org/>.

I. Background

wg(4) is a kernel driver implementing the WireGuard VPN protocol. WireGuard
uses ChaCha20-Poly1305, an authenticated encryption scheme, to protect tunnel
traffic. The Poly1305 message authentication code (MAC) embedded in each
data packet allows the receiver to verify that the packet has not been
tampered with while in transit.

The OpenCrypto framework (OCF) provides a generic interface to the kernel's
implementation of various cryptographic transforms. Consumers submit a
request via crypto_dispatch(), and OCF routes the request to a specific
implementation of the requested transform.

II. Problem Description

After dispatching a decrypt operation to OCF and receiving the result, the
wg(4) driver failed to check whether the MAC verification step succeeded.
The driver thus silently accepted packets with an invalid Poly1305
authentication tag.

III. Impact

A remote attacker who can send UDP packets to a WireGuard endpoint, and who
can guess the bounds of the receiver's replay window, can inject forged or
modified transport data packets into the tunnel.

A remote attacker who can intercept WireGuard packets bound for a FreeBSD
host can modify the ciphertext and authenticated data without detection by
the receiver.

IV. Workaround

No workaround is available. Systems that do not use wg(4) are not affected.

V. Solution

Upgrade your vulnerable system to a supported FreeBSD stable or
release / security branch (releng) dated after the correction date,
and reboot the system.

Perform one of the following:

1) To update your vulnerable system installed from base system packages:

Systems running a 15.0-RELEASE or later version of FreeBSD on the amd64 or
arm64 platforms, which were installed using base system packages, can be
updated via the pkg(8) utility:

# pkg upgrade -r FreeBSD-base
# shutdown -r +10min "Rebooting for a security update"

2) To update your vulnerable system installed from binary distribution sets:

Systems running a RELEASE version of FreeBSD on the amd64 or arm64 platforms
which were not installed using base system packages can be updated via the
freebsd-update(8) utility:

# freebsd-update fetch
# freebsd-update install
# shutdown -r +10min "Rebooting for a security update"

3) To update your vulnerable system via a source code patch:

The following patches have been verified to apply to the applicable
FreeBSD release branches.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

[FreeBSD 15.x]
# fetch https://security.FreeBSD.org/patches/SA-26:52/if_wg-15.patch
# fetch https://security.FreeBSD.org/patches/SA-26:52/if_wg-15.patch.asc
# gpg --verify if_wg-15.patch.asc

[FreeBSD 14.x]
# fetch https://security.FreeBSD.org/patches/SA-26:52/if_wg-14.patch
# fetch https://security.FreeBSD.org/patches/SA-26:52/if_wg-14.patch.asc
# gpg --verify if_wg-14.patch.asc

b) Apply the patch. Execute the following commands as root:

# cd /usr/src
# patch -E -p0 < /path/to/patch

c) Recompile your kernel as described in
<URL:https://www.FreeBSD.org/handbook/kernelconfig.html> and reboot the
system.

VI. Correction details

This issue is corrected as of the corresponding Git commit hash in the
following stable and release branches:

Branch/path Hash Revision
- -------------------------------------------------------------------------
stable/15/ 4c40cb62935f stable/15-n284645
releng/15.1/ b0254d23f508 releng/15.1-n283592
releng/15.0/ 13be8d6d86f3 releng/15.0-n281095
stable/14/ 825c6f45b147 stable/14-n274644
releng/14.4/ b20841b47153 releng/14.4-n273751
- -------------------------------------------------------------------------

Run the following command to see which files were modified by a
particular commit:

# git show --stat <commit hash>

Or visit the following URL, replacing NNNNNN with the hash:

<URL:https://cgit.freebsd.org/src/commit/?id=NNNNNN>

To determine the commit count in a working tree (for comparison against
nNNNNNN in the table above), run:

# git rev-list --count --first-parent HEAD

VII. References

<URL:https://www.cve.org/CVERecord?id=CVE-2026-58085>

The latest revision of this advisory is available at
<URL:https://security.FreeBSD.org/advisories/FreeBSD-SA-26:52.if_wg.asc>

 

TOP