-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

=============================================================================
FreeBSD-SA-26:82.ipsec                                      Security Advisory
                                                          The FreeBSD Project

Topic:          IPsec stream cipher counter reuse

Category:       core
Module:         ipsec
Announced:      2026-11-17
Credits:        R. Christian McDonald, Netgate
Affects:        All supported versions of FreeBSD.
Corrected:      2026-11-17 17:06:01 UTC (stable/15, 15.2-STABLE)
                2026-11-17 17:08:17 UTC (releng/15.1, 15.1-RELEASE-p7)
                2026-11-17 17:02:48 UTC (stable/14, 14.5-STABLE)
                2026-11-17 17:05:10 UTC (releng/14.5, 14.5-RELEASE-p4)
                2026-11-17 17:04:12 UTC (releng/14.4, 14.4-RELEASE-p13)
CVE Name:       CVE-2026-101318

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

IPsec is a suite of protocols providing data authentication, integrity, and
confidentiality between two networked hosts.  When the Encapsulating
Security Payload (ESP) protocol uses the AES-CTR, AES-GCM or
ChaCha20-Poly1305 ciphers, the initialization vector (IV) of each outgoing
packet is taken from a counter maintained for each Security Association
(SA).  The security of these ciphers depends on an IV never being reused
with the same key.

II.  Problem Description

esp_output() incremented the IV counter while holding the SA lock in
shared mode, so packets transmitted concurrently on different CPUs could
be assigned the same counter value.  As a result, multiple packets could
be encrypted with the same IV and key.

III. Impact

An on-path attacker may be able to modify intercepted packets without
detection, and potentially recover the plaintext of packets which share
an IV.

IV.  Workaround

No workaround is available, but systems not using IPsec, or whose SAs do
not use AES-CTR, AES-GCM or ChaCha20-Poly1305, 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.

IV reuse before the update may allow continued forgery of packets on SAs
which keep the same keys.  SAs negotiated by an IKE daemon are replaced
when the system reboots, but manually keyed SAs should be given new keys.

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.

# fetch https://security.FreeBSD.org/patches/SA-26:82/ipsec.patch
# fetch https://security.FreeBSD.org/patches/SA-26:82/ipsec.patch.asc
# gpg --verify ipsec.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/                              fba0e79a68a6    stable/15-n286872
releng/15.1/                            154a5e9e1844  releng/15.1-n283675
stable/14/                              b394b5b13bfb    stable/14-n275577
releng/14.5/                            d80b60653fb8  releng/14.5-n274912
releng/14.4/                            8e8c6f50f30b  releng/14.4-n273812
- -------------------------------------------------------------------------

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-101318>

The latest revision of this advisory is available at
<URL:https://security.FreeBSD.org/advisories/FreeBSD-SA-26:82.ipsec.asc>
-----BEGIN PGP SIGNATURE-----

iQJPBAEBCgA5FiEEthUnfoEIffdcgYM7bljekB8AGu8FAmr82kMbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMCwzAAoJEG5Y3pAfABrvhioP/1zfih4DochNribGhQ1N
8RZaR0MGGwERnkcRSRpKseFpHVMLHwBdGlQbyfoyZJOSbLIOF2Eyb8OLP9/8If7c
whCPty9V13VTHp0uctEJxNqnGjU771bDoybrOQiHBJsHSMGYowp2KATJRpUYxYGM
R5TSLQU07zdmGWAzSD1Oz7GXqBKk7yYiEpJ33Cvvhe0lRd2E1zrEmQZThas/6yUI
Isbt4NFMhFGXn4FePvG362vC/rvFKguyUr2JsiWphxI2/PVeqrBlDeywtEKSoEF0
VX9j0EgeR5LX5VUHBKM4Epa4AuZBjROEys4uuTzPHN6l6joCaGlHLkQN6Iuc+uqK
4LLbV9duX6/AsTkgOSrdVcS9AQ+5gx7ZfEhHcrmTmtpnseD3ChA52N8FRUw7rmbp
XInQuOvfSQk40KVGPuu7DT8BQqa4qklMhVGUCpZqm02VQb0RCw7TfICMAh1COzZO
ggQpn1QXkTXFwzOeoD7F3dDjEhrV4bp1cAUS6SevEtSXKrOfU+TXyTJVSt5f8O7/
QXaKGpEv+ZQpSgJzQ7iFJGRSeDd3orAv+QsvTp5JMomZ79PahQ7eNPKXZggRZddZ
sRdeb74HuOAEPrAWlO/XOJ4rCFMAoq9/lywW85tDFqWLiiq3xJ1xk+AR6cJWbWzi
x3+YPObiF30/1hfuGxHm7p6b
=obIA
-----END PGP SIGNATURE-----