|
首先感谢“loveshe” 提供此BUG 问题是发送者可以发送带脚本的跨站xss ,当接收者打开消息时,可能就中了 解决方法: 打开ks_cls/kesion.commoncls.asp 找到3000多行的如下代码 - '发送站内信息
- '参数Incept--接收者,Sender-发送者,title--主题,Content--信件内容
- Public Function SendInfo(Incept,Sender,title,Content)
- Dim GroupID,Max_Num,RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
- RS.Open "select top 1 groupid from ks_user where username='" & Incept & "'",conn,1,1
- if RS.Eof And RS.Bof Then
- RS.Close:Set RS=Nothing
- SendInfo=false:exit Function
- End If
- GroupID=RS(0)
- RS.Close:Set RS=Nothing
- Max_Num=ChkClng(U_S(GroupID,13))
- If Max_Num<>0 And ChkClng(conn.execute("select count(*) from KS_Message where IsSend=1 and delR=0 and Incept='"&Incept&"'")(0))>=ChkClng(Max_Num) Then
- SendInfo=false:exit Function
- End If
- Conn.Execute("insert Into KS_Message(Incept,Sender,Title,Content,SendTime,Flag,IsSend,DelR,DelS) values('" & Incept & "','" & Sender & "','" & replace(Title,"'","""") & "','" & replace(Content,"'","""") & "'," & SqlNowString & ",0,1,0,0)")
- SendInfo=true
- End Function
并修改为 - '发送站内信息
- '参数Incept--接收者,Sender-发送者,title--主题,Content--信件内容
- Public Function SendInfo(Incept,Sender,title,Content)
- Dim GroupID,Max_Num,RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
- RS.Open "select top 1 groupid from ks_user where username='" & Incept & "'",conn,1,1
- if RS.Eof And RS.Bof Then
- RS.Close:Set RS=Nothing
- SendInfo=false:exit Function
- End If
- GroupID=RS(0)
- RS.Close:Set RS=Nothing
- Max_Num=ChkClng(U_S(GroupID,13))
- If Max_Num<>0 And ChkClng(conn.execute("select count(*) from KS_Message where IsSend=1 and delR=0 and Incept='"&Incept&"'")(0))>=ChkClng(Max_Num) Then
- SendInfo=false:exit Function
- End If
- Conn.Execute("insert Into KS_Message(Incept,Sender,Title,Content,SendTime,Flag,IsSend,DelR,DelS) values('" & Incept & "','" & Sender & "','" & checkxss(replace(Title,"'","""")) & "','" & ClearBadChr(replace(Content,"'","""")) & "'," & SqlNowString & ",0,1,0,0)")
- SendInfo=true
- End Function
增加红色的代码就可以了。这样就可以过滤掉
|