module
FreeBSD ip6_setpktopt Use-After-Free Privilege Escalation
Disclosed | Created |
---|---|
2020-07-07 | 2020-07-30 |
Disclosed
2020-07-07
Created
2020-07-30
Description
This module exploits a race and use-after-free vulnerability in the
FreeBSD kernel IPv6 socket handling. A missing synchronization lock
in the `IPV6_2292PKTOPTIONS` option handling in `setsockopt` permits
racing `ip6_setpktopt` access to a freed `ip6_pktopts` struct.
This exploit overwrites the `ip6po_pktinfo` pointer of a `ip6_pktopts`
struct in freed memory to achieve arbitrary kernel read/write.
This module has been tested successfully on:
FreeBSD 9.0-RELEASE #0 (amd64);
FreeBSD 9.1-RELEASE #0 r243825 (amd64);
FreeBSD 9.2-RELEASE #0 r255898 (amd64);
FreeBSD 9.3-RELEASE #0 r268512 (amd64);
FreeBSD 12.0-RELEASE r341666 (amd64); and
FreeBSD 12.1-RELEASE r354233 (amd64).
FreeBSD kernel IPv6 socket handling. A missing synchronization lock
in the `IPV6_2292PKTOPTIONS` option handling in `setsockopt` permits
racing `ip6_setpktopt` access to a freed `ip6_pktopts` struct.
This exploit overwrites the `ip6po_pktinfo` pointer of a `ip6_pktopts`
struct in freed memory to achieve arbitrary kernel read/write.
This module has been tested successfully on:
FreeBSD 9.0-RELEASE #0 (amd64);
FreeBSD 9.1-RELEASE #0 r243825 (amd64);
FreeBSD 9.2-RELEASE #0 r255898 (amd64);
FreeBSD 9.3-RELEASE #0 r268512 (amd64);
FreeBSD 12.0-RELEASE r341666 (amd64); and
FreeBSD 12.1-RELEASE r354233 (amd64).
Authors
Andy Nguyen
bcoles bcoles@gmail.com
bcoles bcoles@gmail.com
Platform
BSD
Architectures
x64
References
Module Options
To display the available options, load the module within the Metasploit console and run the commands ‘show options’ or ‘show advanced’:

NEW
Explore Exposure Command
Confidently identify and prioritize exposures from endpoint to cloud with full attack surface visibility and threat-aware risk context.