對於傳統的ASP應用程序,我應該刪除所有安全攻擊問題。目前,DB包含已編碼的數據,並且不會再有插入/更新操作。只從現在開始選擇行動。經典ASP ::跨站點腳本(XSS)驗證問題
我能夠刪除SQL注入和其他一些安全問題,但是,無法刪除
跨站點腳本(XSS):可憐的驗證問題
這成爲瓶頸交付項目。
有沒有人可以幫助我做到這一點。
例如: 我在DB中的數據如下。
一個單元格示例數據(韓語和英語字符)
1.. Rupture disc 설치 관련 필요 자재 List<BR>──────────────────────────────────────<BR> No 필요 자재 재질 비 고 <BR>──────────────────────────────────────<BR> 1 inlet isolation valve, 8" Hast C276 기존 재고 사용 <BR> 2 RD holder inlet/outlet Hast C276 / 316L 신규 구매 <BR> 3 Rupture Disc Hast C276 신규 구매 <BR> 4 SV outlet isolation valve, 10" SUS 316L 신규 구매 <BR>──────────────────────────────────────<BR><BR>2. Rupture Disc Specification<BR> 1) Rupture design press : 4kg/cm2<BR> 2) Design temperature : 100℃<BR> 3) Rupture press tolerance : ± 5%<BR> 4) Manufacturing range : + 0%, - 10%<BR> 5) Material spec : M1, M4, C31<BR> 6) Max. allowable oper press : 3.2kg/cm2 (at 100℃)<BR><BR>3. Rupture Disc spec 선정 기준<BR> . Code, Standard = API 520, ASME VIII<BR> . Required Burst Pressure = Vessel Design Pressure<BR> . Manufacturing range(+0% ∼ -10%) of Required Burst Pressure<BR> . Rupture Pressure Tolerance +5%, -5% of Stamped Burst Pressure<BR> . Specified Disc Temperature = Actual Temperature of Disc in Operation <BR> → usually lower at disc than in liquid phase of vessel <BR><BR>4. Rupture Disk 전단 및 SV2209 후단 Isolation valve는 CSO(CAR SEAL OPEN) .<BR><BR>5. Rupture Disk 후단에 PG2209를 설치하여 운전 중 Rupture disk 파손 여부 확인 가능토록 함.<BR>
我顯示上述細胞的數據如下:
示例頁面:
<!-- #include file="INCLUDES/HTMLDecode.inc" -->
.
.
.
<HTML>
.
.
.
sampledata = rs("sampledata")
.
.
.
<TD><%= ClearForAttack(sampledata) =%></TD>
.
.
.
</HTML>
上面功能定義如下:
用戶定義函數:
<%
Function HTMLDecode(sText)
Dim I
sText = Replace(sText, """, Chr(34))
sText = Replace(sText, "<" , Chr(60))
sText = Replace(sText, ">" , Chr(62))
sText = Replace(sText, "&" , Chr(38))
sText = Replace(sText, " ", Chr(32))
For I = 1 to 255
sText = Replace(sText, "&#" & I & ";", Chr(I))
Next
HTMLDecode = sText
End Function
%>
<%
Function ClearForAttack(pStrValue)
if len(pStrValue)>0 then
pStrValue = HTMLDecode(Server.HTMLEncode(pStrValue))
pStrValue = replace(pStrValue,"'","")
pStrValue = replace(pStrValue,"`","")
pStrValue = replace(pStrValue,"%","")
pStrValue = replace(pStrValue,"<","<")
pStrValue = replace(pStrValue,">",">")
else
pStrValue = ""
end if
ClearForAttack = pStrValue
End Function
%>
要我同時使用HTMLDecode和功能的HTMLEncode
請編輯功能顯示已編碼的數據或建議我另一個方法。
非常感謝您的幫助和建議。
在此先感謝。
只需清理郵政/查詢字符串數據。你可以嘗試一些方法,包括'Server.HTMLEncode'。 – Paul
XSS的哪種變體是您遇到的問題? – Juxhin
如上所述,XSS:不合格 – kpgu1718