### 简要描述:
过滤不当
### 详细说明:
最新版下载地址http://www.thinksaas.cn/service/down/
跟前面thinksaas最新版xss2
[WooYun: thinksaas最新版xss2](http://www.wooyun.org/bugs/wooyun-2015-0104006)
thinksaas最新版xss
[WooYun: thinksaas最新版xss](http://www.wooyun.org/bugs/wooyun-2015-0103963)
原理都一样 吐槽下 官网不让注册帐号 就在本地测试了 前人的我测试一个现在还可以
当然 漏洞文件肯定是不一样的
漏洞文件 在app/article/action/add.php 25行中没有过滤 48行插入数据库
```
<?php
defined('IN_TS') or die('Access Denied.');
$userid = aac('user') -> isLogin();
switch ($ts) {
case "" :
if ($TS_APP['allowpost'] == 0 && $TS_USER['isadmin'] == 0) {
tsNotice('系统设置不允许会员发文章!');
}
$cateid = intval($_GET['cateid']);
$title = '发布文章';
include template('add');
break;
case "do" :
if ($_POST['token'] != $_SESSION['token']) {
tsNotice('非法操作!');
}
$cateid = intval($_POST['cateid']);
$title = trim($_POST['title']);//这里没有过滤
$content = tsClean($_POST['content']);
$tag = tsClean($_POST['tag']);
$addtime = date('Y-m-d H:i:s');
if (intval($TS_USER['isadmin']) == 0) {
// 过滤内容开始
aac('system') -> antiWord($title);
aac('system') -> antiWord($content);
aac('system') -> antiWord($tag);
// 过滤内容结束
}
if ($title == '' || $content == '')
tsNotice("标题和内容都不能为空!");
//1审核后显示0不审核
if ($TS_APP['isaudit'] == 1) {
$isaudit = 1;
} else {
$isaudit = 0;
}
$articleid = $new['article'] -> create('article', array('userid' => $userid, 'locationid' => aac('user') -> getLocationId($userid), 'cateid' => $cateid, 'title' => $title, 'content' => $content, 'isaudit' => $isaudit, 'addtime' => date('Y-m-d H:i:s')));
//这里插入
// 上传帖子图片开始
$arrUpload = tsUpload($_FILES['photo'], $articleid, 'article', array('jpg', 'gif', 'png', 'jpeg'));
if ($arrUpload) {
$new['article'] -> update('article', array('articleid' => $articleid), array('path' => $arrUpload['path'], 'photo' => $arrUpload['url']));
}
// 上传帖子图片结束
// 处理标签
aac('tag') -> addTag('article', 'articleid', $articleid, $tag);
// 对积分进行处理
aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'], $TS_URL['ts']);
header("Location: " . tsUrl('article', 'show', array('id' => $articleid)));
break;
}
```
利用过程
http://www.test.com/shenji/thinksaas2.4/index.php?app=article&ac=add发表文章
输入以下内容
[<img src="https://images.seebug.org/upload/201508/05202935bec6d3170094fac3192552e3eea39d1f.png" alt="111111111.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/05202935bec6d3170094fac3192552e3eea39d1f.png)
点击发布 点击我的社区即可触发xss
[<img src="https://images.seebug.org/upload/201508/0520333701df873474e0889bc2f7825605e8aea7.png" alt="22222222.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/0520333701df873474e0889bc2f7825605e8aea7.png)
### 漏洞证明:
[<img src="https://images.seebug.org/upload/201508/05203402000e2186a70dde603495465f75e72ef5.png" alt="22222222.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/05203402000e2186a70dde603495465f75e72ef5.png)
暂无评论