-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= 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 . 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 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 Or visit the following URL, replacing NNNNNN with the hash: 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 The latest revision of this advisory is available at -----BEGIN PGP SIGNATURE----- iQJPBAEBCgA5FiEEthUnfoEIffdcgYM7bljekB8AGu8FAmpqbkkbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMCwzAAoJEG5Y3pAfABrvYT4P/1sjyQxTye1SElCc9UT5 DRVf9QXItIvjnWcsLAyNPd4EPLzhkiCUcnrYHirsSQoz3CiU1/DUev8WjWYJULoP 1zx8U/6xxz3x9aTFb9MEKRBt5jQ62PUGXCLf8SsYiFDFoKuIAYljl5q2J1QkfINc hwCaYZbqYLunCztREtyfI4NKx5PzqS9paAlY0h85u09hvXOGgz0NeZsaztSjNpTl i0VUbpP3KAtZyRRYgt1EpHxPkUEpvE9k2KU8cz7B5WZG3x7iwJQAk0kEq66MBx2L dxyPpTPOM0xkkgdffZ3rGFC0tCBF1uqij0Z07ltiOmJDRJBN2imHhHv1QH/8CtwA UpK3ukTq5ZRkh7dRy87v/ClirQCgMAHTy4L/sTI9imEp7m/6Hzv6Kse4UIhUo+wI sisC+Hmeb/tw716QNrZeF6CT7D3V82F3VYEBNc7+e6OACEYilmKyyKp6+3sczbv0 6IBgUjW8wQAWif2tbifQEUnxwpGhvVIAurZKnmKKN3y5OsHjaj48Lc36woVpxXPX jvuQflUEPPXsR6du4jPVceMAA+tN5fHnGmjWba5E1RtjSqIU6Q74L2hpfTA58Y2q yi/vSnOWk84jqXrUuL5JSGsSEQYGshOxHcWyeHndXxGMOjFmgmaoFDtVPvBQwuCo 0FQ8Cxd/bOL+VieyaGH14wtk =xml5 -----END PGP SIGNATURE-----