我在注入js代码ex时使用vue-toasted。在输入中"><img src=1 onerror=prompt(document.cookie);>
,然后点击提交。
和console.log(response.data.message);
显示:
Created Site ""><img src=1 onerror=prompt(document.cookie);>" successfully!
vue正在逃避html,但toasted
不是,这是代码:
handleFormSubmit: function(response) {
this.showAddSiteModal = false;
if (response.data.status === 'success')
{
console.log(response.data.message);
this.$toasted.success(response.data.message); //<<< problem here
this.addSite(response.data.site);
}
else
{
this.$toasted.error(response.data.message);
}
},