第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

ajax響應(yīng)返回html響應(yīng)(XSS veracode)

ajax響應(yīng)返回html響應(yīng)(XSS veracode)

UYOU 2021-04-27 14:16:54
function viewAcc() {    var errorMsg = "";    var result = true;    $(".errorView").hide();    var accNum = document.getElementById('custAccNum').value;    var accType = document.getElementById('custAccType').value;    $("#overlayPopup").show();    $.ajax({        url : '<attribute:resourceURL/>',        data : {            "custNo" : accNum ,            "custType" : accType         },        success : function(data) {            if (data == 'CUS_ACC') {                window.location = "/cust/account/c";            } else {                $("#overlayPopup").hide();                //display warning                $(".errorView").show();                $(".errorView").html(data); // <--- XSS line                e.preventDefault();            }        },        cache : false,        dataType : 'text',        error : function(error, textStatus, errorThrown) {            alert('error in ajax call: ' + textStatus);            console.log('error in ajax call: ' + textStatus);            window.location = "/cust/account/c/lookup";        },        timeout : ajaxTimeOutMilliSeconds    });}因此,veracode指出我在$(".errorView").html(data); 如何解決此問(wèn)題上有問(wèn)題。如果我只是將其轉(zhuǎn)換為文本,它是否會(huì)像html一樣顯示在客戶(hù)端上?
查看完整描述

2 回答

?
慕萊塢森

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

不要盲目相信那些聲稱(chēng)您容易受到XSS攻擊的工具。

僅當(dāng)XSS的值不可信時(shí),您才有遭受XSS的風(fēng)險(xiǎn)data。由于它來(lái)自您自己的服務(wù)器,因此您應(yīng)該已經(jīng)對(duì)XSS問(wèn)題的數(shù)據(jù)進(jìn)行了清理,然后再將其發(fā)送到對(duì)Ajax請(qǐng)求的響應(yīng)中。


查看完整回答
反對(duì) 回復(fù) 2021-05-27
  • 2 回答
  • 0 關(guān)注
  • 236 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)