当前位置:网站首页>网络安全漏洞分析与漏洞复现
网络安全漏洞分析与漏洞复现
2022-07-28 06:47:00 【大安全家】
前言
4月6日和5月18日,VMware官方发布的两则安全公告中显示,关乎旗下产品的CVE漏洞多达10个,其中不乏有CVSSv3评分9.8的高危漏洞!如此高频的出洞速率,吸引了笔者注意。笔者将对CVE-2022-22954 VMware Workspace ONE Access SSTI RCE 漏洞进行细致分析。
漏洞描述
根据4月6日VMware官方发布的安全公告,官方已更新解决了多个产品的安全问题。其中CVE-2022-22954,CVSS评分为9.8,危害等级为严重。该漏洞是由于VMware Workspace ONE Access and Identity Manager 包含一个服务器端模板注入漏洞,导致具有网络访问权限的恶意攻击者可进行远程代码执行。
利用范围
VMware Workspace ONE Access 21.08.0.1, 21.08.0.0,20.10.0.1, 20.10.0.0
VMware Identity Manager(vIDM) 3.3.6, 3.3.5, 3.3.4, 3.3.3
VMware vRealize Automation(vIDM) 7.6
VMware Cloud Foundation (vIDM) 4.x
漏洞分析
使用内置函数将字符串计算为 FTL 表达式,FTL 表达式可以访问变量,并调用 Java 方法,例如 “1+2”?eval将返回数字 3,所以?eval前的字符串因来自不受信任的来源,可能就会成为攻击媒介。
在Vmware中的endusercatalog-ui-1.0-SNAPSHOT-classes.jar自带的模板customError.ftl就调用了freemarker引擎的eval函数来渲染errObj,这就导致了本次SSTI注入漏洞。
【一一帮助安全学习,所有资源获取处一一】
①网络安全学习路线
②20份渗透测试电子书
③安全攻防357页笔记
④50份安全攻防面试指南
⑤安全红队渗透工具包
⑥信息收集80条搜索语法
⑦100个漏洞实战案例
⑧安全大厂内部视频资源
⑨历年CTF夺旗赛题解析
环境搭建
本次漏洞分析源码所在位置:/opt/vmware/horizon/workspace/webapps/catalog-portal/WEB-INF/lib。
动态调式
已经定位到安全问题所在,接下来寻找渲染customError.ftl模板的相关代码。
在com.vmware.endusercatalog.ui.web.UiErrorController#handleGenericError函数中。
errorObj由参数传入。
查找handleGenericError函数的被调用关系发现。
handleGenericError函数受如上图所示的两个requestMapping所在的控制器UiErrorController调用。
跟进其中出现的getErrorPage函数,位于com.vmware.endusercatalog.ui.web.UiErrorController#getErrorPage。
除了直接用handleGenericError函数拿到需要渲染的模板,还存在handleUnauthorizedError函数通过条件判断,只有一个分支进入handleGenericError
如何构造参数?
在两个requestMapping中,其中的/ui/view/error为API接口,直接访问无法从请求中提取javax.servlet.error.message,从而无法控制errorObj。
寻找/ui/view/error的其他调用,位于com.vmware.endusercatalog.ui.web.UiApplicationExceptionResolver#resolveException函数。
存在对javax.servlet.error.message赋值的过程。
查看resolveException函数的被调用关系,受上方handleAnyGenericException函数调用。
其中@ExceptionHandler表明,该处为异常处理器,当程序直接抛出Exception类型的异常时会进入handleAnyGenericException,再通过调用resolveException函数,进行赋值,最终都会返回/ui/view/error。
而在 handleAnyGenericException 中,进入 resolveException 时会根据异常的类型传入不同的参数,如果异常类不是 LocalizationParamValueException 子类的话则传入 uiRequest.getRequestId(),所以我们需要构造参数可控的地方还需要抛出 LocalizationParamValueException 异常类或其子类异常,这样errorObj所需Attribute errorJson来自LocalizationParamValueException异常的getArgs。
在LocalizationParamValueException函数,如果可以控制抛出异常的参数,就可以把payload传入errorObj。
在endusercatalog-auth-1.0-SNAPSHOT.jar中com.vmware.endusercatalog.auth.InvalidAuthContextException,存在一个InvalidAuthContextException异常,继承于LocalizationParamValueException。
在com.vmware.endusercatalog.auth.AuthContext构造函数中抛出异常。
生成 AuthContext对象的地方在AuthContextPopulationInterceptor 拦截器中,而且各项参数均是从请求中获取,这里可构造注入点。
但正常情况下,在 endusercatalog-auth-1.0-SNAPSHOT.jar 中的拦截器类无法访问到类。
但在com.vmware.endusercatalog.ui.UiApplication,使用 @ComponentScan 注解声明自动将com.vmware.endusercatalog.auth包的类装配进bean容器。
在包中com.endusercatalog.ui.config.WebConfig可查找到。
可进行构造的url。
通过如上分析,可构造payload,进行命令执行。
漏洞复现

修复建议
边栏推荐
- 机械革命蛟龙p有线网卡驱动打不上
- Allure use
- Usage of qmap
- Prescan quick start to proficient in lecture 17, speed curve editor
- leetcode/排序数组中两个数字之和
- Detailed explanation of random number generated by random class
- js卡通英文字母打字小游戏源码
- Openstack dashboard configuring public network access
- OpenTSDB-时序数据库
- CAT1 4G+以太网开发板232数据通过4G模块TCP发到服务器
猜你喜欢

@The role of documented

半桥BUCK电路—记录篇

Common solutions for distributed ID - take one

EMC EMI磁珠的特性

Huawei Senior Engineer -- BGP routing filtering and community attributes

Change the dataDir path after mysql8.0.16 installation
![[leetcode] 24. Exchange nodes in the linked list in pairs](/img/06/af8cffd306777b14a4989e638f5866.png)
[leetcode] 24. Exchange nodes in the linked list in pairs
![[pyqt] pyqt development experience_ How to find events and methods of controls](/img/40/7597d6413c88793e22276325d5f602.png)
[pyqt] pyqt development experience_ How to find events and methods of controls

JS thoroughly understand this point

Record a MYCAT connection and solve the problems of communications link failure
随机推荐
Enum class
Qt使用信号量控制线程(QSemaphore)
leetcode/单词长度的最大乘积
【17】 Establish data path (upper): instruction + operation =cpu
[book club issue 13] Chapter 2 notes on the packaging format and coding format of video files
[chart component kit] Shanghai daoning provides developers with steema download, trial and tutorial
Unity切换到另一个场景的时候,发现该场景变暗了
Understanding of spark operator aggregatebykey
Usage of constructors
Prescan quick start to proficient in lecture 17, speed curve editor
uniapp的swiper动态设置current值不生效解决办法
Parse tree structure JS
Can a flinksql script write insert statements for two tables?
js卡通英文字母打字小游戏源码
What if the computer desktop icon has a small yellow lock?
Usage of qgroupbox
Common solutions for distributed ID - take one
C#,入门教程——程序运行时的调试技巧与逻辑错误探针技术与源代码
2022牛客多校第二场解题报告
Can the variable modified by final be modified