## 漏洞信息:
Z-Blog是由RainbowSoft Studio开发的一款小巧而强大的基于Asp平台的Blog程序。
在FUNCTION/c_function.asp中,程序处理UBB标签的时候存在漏洞,导致任何用户可以在目标页面内执行任意js代码,利用该代码恶意用户可以获取目标站点的所有权限。
## 漏洞分析:
在FUNCTION/c_function.asp中,漏洞代码如下:
```
Function UBBCode(ByVal strContent,strType)
Dim objRegExp
Set objRegExp=new RegExp
objRegExp.IgnoreCase =True
objRegExp.Global=True
If ZC_UBB_LINK_ENABLE And Instr(strType,"[link]")>0 Then
objRegExp.Pattern="([URL])(([a-zA-Z0-9]+?)://S+?)([/URL])"
strContent= objRegExp.Replace(strContent,"$2")
objRegExp.Pattern="([URL])(.+?)([/URL])"
strContent= objRegExp.Replace(strContent,"$2")
objRegExp.Pattern="([URL=)(([a-zA-Z0-9]+?)://S+?)(])(.+?)([/URL])"
strContent= objRegExp.Replace(strContent,"$5")
objRegExp.Pattern="([URL=)(S+?)(])(S+?)([/URL])"
strContent= objRegExp.Replace(strContent,"$4")
objRegExp.Pattern="([EMAIL])(S+@S+?)([/EMAIL])"
strContent= objRegExp.Replace(strContent,"$2")
objRegExp.Pattern="([EMAIL=)(S+@S+?)(])(.+?)([/EMAIL])"
strContent= objRegExp.Replace(strContent,"$4")
End If
```
可以看到其中的正则表达式过滤并不严格,这种循环匹配也很容易出现逻辑问题,精心构造代码即可触发跨站脚本漏洞,可以发表评论如下:
```
[URL][URL]http://=''style='c:expression(alert())'[/URL][/URL]
```
上面代码将循环执行alert(),当然,你也可以引入自己的恶意js执行。
## 解决方案:
建议关注官网网站,及时升级最新版本:
http://www.zblogcn.com/
暂无评论