Skip to content
Race condition Disclosed report Advanced

Use-After-Free In IPV6_2292PKTOPTIONS leading To Arbitrary Kernel R/W Primitives

A missing lock in the handling of the IPV6_2292PKTOPTIONS socket option allows a race condition that frees a kernel buffer while it is still in use. An attacker can hijack pointers in the freed structure to gain arbitrary kernel read/write and achieve code execution.

Andy Nguyen Follow

Originally disclosed on HackerOne

Bounty$10,000 High View original
  • Triaged in 4 days
  • Fixed in 35 days
  • Paid in 5 days
  • Disclosed after 4 months

Summary

Due to missing locks in option IPV6_2292PKTOPTIONS of setsockopt , it is possible to race and free the struct ip6_pktopts buffer, while it is being handled by ip6_setpktopt. This structure contains pointers (ip6po_pktinfo) that can be hijacked to obtain arbitrary kernel R/W primitives. As a consequence, it is easy to have kernel code execution. This vulnerability is reachable from WebKit sandbox and is available in the latest FW, that is 7.02.

Attachment

Attached is a Proof-Of-Concept that achieves a Local Privilege Escalation on FreeBSD 9 and FreeBSD 12.

Impact

  • In conjunction with a WebKit exploit, a fully chained remote attack can be achieved.
  • It is possible to steal/manipulate user data.
  • Dump and run pirated games.

The original report as published on HackerOne, by theflow0. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the code path for IPV6_2292PKTOPTIONS in setsockopt lacks proper locking, allowing a race between freeing and using the ip6_pktopts structure.

Impact

An attacker could escalate privileges locally and, combined with a WebKit exploit, achieve a fully chained remote attack; the vulnerability is reachable from the WebKit sandbox and present in the latest firmware.

What the attacker needed

Local access to the device; ability to trigger setsockopt; WebKit sandbox escape for remote chain

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a program sets a network option, the operating system kernel stores some data in memory. Here, two actions can happen at the same time: one frees that memory while another still uses it, which is called a use-after-free. Because the freed memory still contains pointers the kernel trusts, an attacker can take control of the kernel.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More by Andy Nguyen

View all

7 more disclosed reports, best first.

More from PlayStation

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.