账号通
    

账号  

密码  

4910

查看

12

回复
主题:[分享]V8.0x 会员中心短消息存在发送消息时跨站xss bug的修正 [收藏主题] 转到:  
科汛官方 当前离线

47268

主题

145

广播

405

粉丝
添加关注
级别:管理员

用户积分:101604 分
登录次数:7935 次
注册时间:2006/12/7
最后登录:2023/12/14
科汛官方 发表于:2011/12/1 9:59:10   | 显示全部帖子 查看该作者主题 楼主 
科汛在线商城系统(NET)

首先感谢“loveshe” 提供此BUG



问题是发送者可以发送带脚本的跨站xss ,当接收者打开消息时,可能就中了



解决方法:



打开ks_cls/kesion.commoncls.asp 找到3000多行的如下代码

  1. '发送站内信息
  2. '参数Incept--接收者,Sender-发送者,title--主题,Content--信件内容
  3. Public Function SendInfo(Incept,Sender,title,Content)
  4.    Dim GroupID,Max_Num,RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
  5.    RS.Open "select top 1 groupid from ks_user where username='" & Incept & "'",conn,1,1
  6.    if RS.Eof And RS.Bof Then
  7.      RS.Close:Set RS=Nothing
  8.   SendInfo=false:exit Function
  9.    End If
  10.    GroupID=RS(0)
  11.    RS.Close:Set RS=Nothing
  12.    Max_Num=ChkClng(U_S(GroupID,13))
  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
  14.   SendInfo=false:exit Function
  15.    End If
  16.    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)")
  17.    SendInfo=true
  18. End Function





并修改为

  1. '发送站内信息
  2. '参数Incept--接收者,Sender-发送者,title--主题,Content--信件内容
  3. Public Function SendInfo(Incept,Sender,title,Content)
  4.    Dim GroupID,Max_Num,RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
  5.    RS.Open "select top 1 groupid from ks_user where username='" & Incept & "'",conn,1,1
  6.    if RS.Eof And RS.Bof Then
  7.      RS.Close:Set RS=Nothing
  8.   SendInfo=false:exit Function
  9.    End If
  10.    GroupID=RS(0)
  11.    RS.Close:Set RS=Nothing
  12.    Max_Num=ChkClng(U_S(GroupID,13))
  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
  14.   SendInfo=false:exit Function
  15.    End If
  16.    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)")
  17.    SendInfo=true
  18. End Function





增加红色的代码就可以了。这样就可以过滤掉



 
  支持(1) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.23438秒 powered by KesionCMS 9.0