I am testing a web application where input from the user is inserted without encoding into the response, but the content type of the response is text/javascript;charset=UTF-8
.
Input from two parameters from the user application returns inside the JavaScript like this:
throw 'allowScriptTagRemoting is false.';
//#DWR-INSERT
//#DWR-REPLY
var s0={};
dwr.engine._remoteHandleCallback('1','0',{application:"param1",changedParts:null,module:"param2",nextModule:null,reload:true,showDialog:false,strokeActions:s0,viewMember:""});
But when I am trying to end the remoteHandleCallback
by inserting "
and }
, these characters are escaped with backslash and treated as a part of the string, for example:
application:"\"param1"
Is this a proper defense against XSS and other vulnerabilities?