In the Linux kernel, the following vulnerability has been resolved:
netfilter: nf_conntrack: avoid truncating IPv6 nexthdr offset
find_prev_fhdr() returns the offset of the Next Header field before an
IPv6 Fragment header through an int pointer, but stores the offset in a
u8 local. An extension header chain can put this field beyond byte 255,
causing the offset to wrap before it is saved in the fragment queue.
Reassembly later uses the wrapped value to update the preceding Next
Header field. This overwrites another byte in the IPv6 header chain and
can make conntrack parse a different transport tuple from the one used
by IPv6 local delivery. A two-fragment packet can, for example, be
recorded as UDP destination port 53 while its payload is delivered to
UDP port 9999.
Use int for the working offset, matching the output argument and the
other offset variables in this path.
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
CVSS Score: 9.1
AV:N - The extension-header chain and Fragment header walked by find_prev_fhdr() arrive in remote IPv6 fragments via ipv6_rcv -> NF_INET_PRE_ROUTING -> ipv6_defrag -> nf_ct_frag6_gather; the sender alone builds a chain whose pre-fragment Next Header field lies past byte 255, and the transport is routable IPv6.
AC:L - The sender chooses both the wrapped offset and the byte nf_ct_frag6_reasm() writes there (the Fragment header's nexthdr), and the write happens deterministically when the queue completes, with no race. The only precondition is an active nf_defrag_ipv6, which is present whenever the IPv6 conntrack filtering being bypassed is configured.
PR:N - nf_ct_frag6_gather() runs on every received IPv6 fragment before any filtering or socket lookup, so the attacker only sends packets and needs no account or credentials. The ruleset that registers the defrag hook is the victim's configuration, not an attacker privilege.
UI:N - No user action is involved; the kernel automatically reassembles the fragments in PRE_ROUTING and then classifies and delivers the result.
S:U - The effect is a wrong verdict by the host's own netfilter policy and a misparse in the host's own IPv6 input path; no VM, container or IOMMU boundary is crossed.
C:H - After the truncated write, ipv6_get_l4proto() and ipv6_find_hdr() walk the chain from the IPv6 header and classify one L4 header, while ip6_protocol_deliver_rcu() uses IP6CB->nhoff and the reset transport header and delivers another. This exposes locally firewalled UDP/TCP listeners and their data to the sender.
I:H - The sender sets the tuple that conntrack records and nftables/ip6tables match (e.g. allowed UDP 53) independently of the tuple delivered (e.g. UDP 9999, per the fix commit), defeating the inbound packet-filter policy for arbitrary ports. The stray byte write also corrupts the reassembled packet's header.
A:N - skb_network_header(skb)[fq->nhoffset] lands at a smaller offset than the real field, inside the first fragment's linear header already pulled by pskb_may_pull(skb, fhoff + sizeof(*fhdr)). No memory outside the packet is corrupted, and there is no oops, hang or leak.
| Attack Vector |
Network |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
None |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
None |
AV:N - The extension-header chain and Fragment header walked by find_prev_fhdr() arrive in remote IPv6 fragments via ipv6_rcv -> NF_INET_PRE_ROUTING -> ipv6_defrag -> nf_ct_frag6_gather; the sender alone builds a chain whose pre-fragment Next Header field lies past byte 255, and the transport is routable IPv6.
AC:L - The sender chooses both the wrapped offset and the byte nf_ct_frag6_reasm() writes there (the Fragment header's nexthdr), and the write happens deterministically when the queue completes, with no race. The only precondition is an active nf_defrag_ipv6, which is present whenever the IPv6 conntrack filtering being bypassed is configured.
PR:N - nf_ct_frag6_gather() runs on every received IPv6 fragment before any filtering or socket lookup, so the attacker only sends packets and needs no account or credentials. The ruleset that registers the defrag hook is the victim's configuration, not an attacker privilege.
UI:N - No user action is involved; the kernel automatically reassembles the fragments in PRE_ROUTING and then classifies and delivers the result.
S:U - The effect is a wrong verdict by the host's own netfilter policy and a misparse in the host's own IPv6 input path; no VM, container or IOMMU boundary is crossed.
C:H - After the truncated write, ipv6_get_l4proto() and ipv6_find_hdr() walk the chain from the IPv6 header and classify one L4 header, while ip6_protocol_deliver_rcu() uses IP6CB->nhoff and the reset transport header and delivers another. This exposes locally firewalled UDP/TCP listeners and their data to the sender.
I:H - The sender sets the tuple that conntrack records and nftables/ip6tables match (e.g. allowed UDP 53) independently of the tuple delivered (e.g. UDP 9999, per the fix commit), defeating the inbound packet-filter policy for arbitrary ports. The stray byte write also corrupts the reassembled packet's header.
A:N - skb_network_header(skb)[fq->nhoffset] lands at a smaller offset than the real field, inside the first fragment's linear header already pulled by pskb_may_pull(skb, fhoff + sizeof(*fhdr)). No memory outside the packet is corrupted, and there is no oops, hang or leak.
CVSS 3.1