Client-side Javascript injection by assinging the output of window.location.href.substr to a variable

Sample code:
function winLoad() {
var sessionId = ”;
if (window.location == window.top.location) {
var semicolonIndex = window.location.href.indexOf(‘;’);
if (semicolonIndex != -1) {
var questionMarkInd… Continue reading Client-side Javascript injection by assinging the output of window.location.href.substr to a variable

Can I use a ServiceWorker to prevent an XSS attacker from gaining access to private user data?

I run a small blogging platform, and I want my users to be able to embed javascript that runs on their blogs (to manipulate the DOM, etc. as you might if you were hosting your own website). However, I do not want them to be able to:

acces… Continue reading Can I use a ServiceWorker to prevent an XSS attacker from gaining access to private user data?