Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-46689 PoC — Apple iOS 和 macOS 竞争条件问题漏洞

Source
Associated Vulnerability
Title:Apple iOS 和 macOS 竞争条件问题漏洞 (CVE-2022-46689)
Description:Apple iOS和Apple macOS都是美国苹果(Apple)公司的产品。Apple iOS是一套为移动设备所开发的操作系统。Apple macOS是一套专为Mac计算机所开发的专用操作系统。 Apple iOS 和 macOS存在竞争条件问题漏洞。目前尚无此漏洞的相关信息,请随时关注CNNVD或厂商公告。
Description
Example of CVE-2022-46689 aka MacDirtyCow.
Readme
# MacDirtyCow

Example of CVE-2022-46689 aka MacDirtyCow.

## What?

MacDirtyCow is a privilege escalation vulnerability in macOS, similar to the Dirty COW vulnerability in Linux. The vulnerability resides in the copy-on-write (COW) mechanism used by macOS's XNU kernel. The vulnerability allows an attacker to modify read-only root-owned files, which could lead to an attacker gaining root privileges on the affected system.

The vulnerability is caused by a race condition in the way macOS's XNU kernel handles copy-on-write (COW) operations on memory pages. When a memory page is marked read-only, but also marked as copy-on-write, the kernel will create a new copy of the page when a write operation is performed on the page. However, there is a small window of time between the read-only page being checked and the new copy being created where an attacker could modify the page in memory, effectively bypassing the read-only restriction.

## PoC

This code (`poc.c`) opens a file specified as a command line argument and maps it into memory using mmap(). It then creates a copy of the file and modifies the memory-mapped copy of the file by filling it with the character 'A'. Finally, the original file is overwritten with the modified copy of the file.
File Snapshot

[4.0K] /data/pocs/5f99ea99acc4dad750100010065066ebc4600748 ├── [ 530] poc.c └── [1.2K] README.md 0 directories, 2 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.