Fix a Self-XSS vulnerability
Big thanks to Nicolas (nicolas.decayeux@intrinsec.com)
This commit is contained in:
parent
cd2521a81d
commit
92d0af3a93
|
|
@ -17,7 +17,7 @@ var scripts = document.getElementsByTagName('script'),
|
||||||
|
|
||||||
|
|
||||||
var tarteaucitron = {
|
var tarteaucitron = {
|
||||||
"version": 20200521,
|
"version": 20200730,
|
||||||
"cdn": cdn,
|
"cdn": cdn,
|
||||||
"user": {},
|
"user": {},
|
||||||
"lang": {},
|
"lang": {},
|
||||||
|
|
@ -1362,9 +1362,9 @@ var tarteaucitron = {
|
||||||
html += '</div><ul class="cookie-list">';
|
html += '</div><ul class="cookie-list">';
|
||||||
}
|
}
|
||||||
html += '<li class="tarteaucitronCookiesListMain">';
|
html += '<li class="tarteaucitronCookiesListMain">';
|
||||||
html += ' <div class="tarteaucitronCookiesListLeft"><button type="button" onclick="tarteaucitron.cookie.purge([\'' + cookies[i].split('=', 1) + '\']);tarteaucitron.cookie.number();tarteaucitron.userInterface.jsSizing(\'cookie\');return false"><strong>×</strong></button> <strong>' + name + '</strong>';
|
html += ' <div class="tarteaucitronCookiesListLeft"><button type="button" onclick="tarteaucitron.cookie.purge([\'' + tarteaucitron.fixSelfXSS(cookies[i].split('=', 1)) + '\']);tarteaucitron.cookie.number();tarteaucitron.userInterface.jsSizing(\'cookie\');return false"><strong>×</strong></button> <strong>' + tarteaucitron.fixSelfXSS(name) + '</strong>';
|
||||||
html += ' </div>';
|
html += ' </div>';
|
||||||
html += ' <div class="tarteaucitronCookiesListRight">' + cookies[i].split('=').slice(1).join('=') + '</div>';
|
html += ' <div class="tarteaucitronCookiesListRight">' + tarteaucitron.fixSelfXSS(cookies[i].split('=').slice(1).join('=')) + '</div>';
|
||||||
html += '</li>';
|
html += '</li>';
|
||||||
}
|
}
|
||||||
html += '</ul>';
|
html += '</ul>';
|
||||||
|
|
@ -1394,6 +1394,10 @@ var tarteaucitron = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fixSelfXSS": function(html) {
|
||||||
|
fixed = html.toString().replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
||||||
|
return fixed;
|
||||||
|
},
|
||||||
"getLanguage": function () {
|
"getLanguage": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue