security - 我们可以覆盖 JSON.stringify 来获取 XSS
问题描述
我们如何绕过这个函数来获得完整的 XSS?
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
response = JSON.parse(xmlHttp.responseText);
AnyFunction(response);
}
else if (xmlHttp.readyState == 4 && xmlHttp.status != 200) {
console.log(xmlHttp.responseText);
}
}
xmlHttp.open('POST', url, true);
xmlHttp.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');
xmlHttp.setRequestHeader('Accept', 'application/json');
data = {'searchTerm':item}
xmlHttp.send(JSON.stringify(data));
用户输入只有一个搜索栏。
解决方案
推荐阅读
- python - Wxpython:将所有滚动面板保存为图像
- reactjs - Apollo 客户端查询参数函数返回未定义
- ffmpeg - 使用 ffmpeg-php 上传视频时正在创建缩略图图像
- node.js - npm、pnpm、yarn 或 pkglink 以节省时间和磁盘空间?
- python - 在 For 循环中,如何解压缩“枚举”和另一个对三个变量的可迭代
- python - 我可以一次从一个文件夹中导入所有 Python 文件吗?
- java - HttpsURLConnection:使用 IDE JDK 可用于身份验证,但不适用于 JRE!这很奇怪
- python - 如何将用户输入与字典索引匹配?
- docker - 未经授权:拉取 sequenceiq/hadoop-docker:2.7.1 时需要身份验证
- machine-learning - 反向传播、交叉熵损失和 Softmax 函数