-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
=============================================================================
FreeBSD-SA-23:10.pf Security Advisory
The FreeBSD Project
Topic: pf incorrectly handles multiple IPv6 fragment headers
Category: core
Module: pf
Announced: 2023-09-06
Credits: Enrico Bassetti bassetti@di.uniroma1.it
(NetSecurityLab @ Sapienza University of Rome)
Affects: All supported versions of FreeBSD.
Corrected: 2023-08-04 14:08:05 UTC (stable/13, 13.2-STABLE)
2023-09-06 16:58:39 UTC (releng/13.2, 13.2-RELEASE-p3)
2023-08-04 14:14:08 UTC (stable/12, 12.4-STABLE)
2023-09-06 17:38:31 UTC (releng/12.4, 12.4-RELEASE-p5)
CVE Name: CVE-2023-4809
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
pf is an Internet Protocol packet filter originally written for OpenBSD.
pf can reassemble fragmented IPv6 packets in order to apply rules on the
reassembled packet. This allows pf to filter based on the upper layer
protocol (e.g. TCP, UDP) information.
IPv6 packets may be fragmented by the originating node, and will then contain
a fragment extension header. An IPv6 packet will normally contain only one
fragment extension header.
II. Problem Description
With a 'scrub fragment reassemble' rule, a packet containing multiple IPv6
fragment headers would be reassembled, and then immediately processed. That
is, a packet with multiple fragment extension headers would not be recognized
as the correct ultimate payload. Instead a packet with multiple IPv6 fragment
headers would unexpectedly be interpreted as a fragmented packet, rather than
as whatever the real payload is.
III. Impact
IPv6 fragments may bypass firewall rules written on the assumption all
fragments have been reassembled and, as a result, be forwarded or processed
by the host.
IV. Workaround
No workaround is available but systems not using the pf firewall 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.
Perform one of the following:
1) To update your vulnerable system via a binary patch:
Systems running a RELEASE version of FreeBSD on the amd64, i386, or
(on FreeBSD 13 and later) arm64 platforms can be updated via the
freebsd-update(8) utility:
# freebsd-update fetch
# freebsd-update install
# shutdown -r +10min "Rebooting for a security update"
2) 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 13.2]
# fetch https://security.FreeBSD.org/patches/SA-23:10/pf.13.patch
# fetch https://security.FreeBSD.org/patches/SA-23:10/pf.13.patch.asc
# gpg --verify pf.13.patch.asc
[FreeBSD 12.4]
# fetch https://security.FreeBSD.org/patches/SA-23:10/pf.12.patch
# fetch https://security.FreeBSD.org/patches/SA-23:10/pf.12.patch.asc
# gpg --verify pf.12.patch.asc
b) Apply the patch. Execute the following commands as root:
# cd /usr/src
# patch < /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 by the corresponding Git commit hash or Subversion
revision number in the following stable and release branches:
Branch/path Hash Revision
- -------------------------------------------------------------------------
stable/13/ 3a0461f23a4f stable/13-n255953
releng/13.2/ 41b7760991ef releng/13.2-n254631
stable/12/ r373157
releng/12.4/ r373186
- -------------------------------------------------------------------------
For FreeBSD 13 and later:
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
For FreeBSD 12 and earlier:
Run the following command to see which files were modified by a particular
revision, replacing NNNNNN with the revision number:
# svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base
Or visit the following URL, replacing NNNNNN with the revision number:
<URL:https://svnweb.freebsd.org/base?view=revision&revision=NNNNNN>
VII. References
<URL:https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-4809>
The latest revision of this advisory is available at
<URL:https://security.FreeBSD.org/advisories/FreeBSD-SA-23:10.pf.asc>
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEthUnfoEIffdcgYM7bljekB8AGu8FAmT4vykACgkQbljekB8A
Gu9Mow//ZodkaAf0AGC2T+CSDco592Mq7+T8V5YyqIZxGXRn55sFuVKS8cQ8a0cT
DJ98QV0ht0WITYrBPGbllzVvT4w3bos1U0SB2z3tPjrbfNL8vaXgVl/Du3KZaPAs
0h4fNR/R3b6XzHgFhqYKG8Q7/u21fLmwu9HpYHQ7nplWg2mS2uQeuTMtr+uoOBS2
XPc/FpYtL2VXO2aEY3K1A/QCY6lBRxqKTTEi01j9gnyuK4L3QoLWqDdrAKM3RoDc
wmstnn/KQAJkeMnmIOmDh0GdnAVdVyPBdI0KM86pz5L0AT0uQib0sal0yj72kCsg
oi6flocqESDNzYPgh/nZEjCHzcRhGWxcsjhTzjBQSTW/HSarQ+wbZuIpUlUQG3A6
oEhRBj201t4+FUSwCQfr5QdivxwtMHHJYSXqo4nyD3AsRQ2HTnFNcqq26h+bgjhR
HmdBvffQ5lQUrtDKDb4XXr8RLFbk2RmjeD/zZfb1zhezSmJi4cD6LrClxer5aRFo
djoqVwjzKsg/9gLaDqr/UDObF6Ke6hs03yTs1Hjrp/DV29wWjJ8NKShezIEJOPTm
lgK+jhcEbs5vR4woG3vll7Jfaz7W8vniM9cOz/7bvWOp924cHMmwWFod4DMVf9ry
USB3v/ClFl5caJnoYYwKiIfc/EyYrprTvMLcO6yzDkhWUlaws88=
=bpCy
-----END PGP SIGNATURE-----