I recently found a website which could be vulnerable to postMessage attack and lets set any code within the title tags but strangely code is not executed.
Here is what code does:
var m = function(e) {
var d = JSON.parse(e.data);
document.title = d.title
.....
window.addEventListener('message', m, false);
So everything I pass through window.postMessage(’{“title”:“JAVASCRIPT CODE HERE”}’, ‘*’) is fully reflected in title, however not executed.
Reflection in source-code (Chrome Browser):
Is it beause it is set through document.title? And are there ways to make it executable?
I misinterpreted your original message. I thought you were able to control the way the title is set. It looks like you’re not. So there’s no possibility for an XSS here.