How the Trivy supply chain attack harvested credentials from secrets managers

原始链接: https://vaultproof.dev/blog/trivy-supply-chain-attack

## Trivy 供应链攻击总结 (2026) 2026年3月,一场复杂的供应链攻击破坏了Aqua Security的Trivy漏洞扫描器。攻击者将窃取凭证的恶意软件注入到官方Trivy发布版中,使其能够静默地从CI/CD环境中窃取明文API密钥。关键在于,攻击并未利用代码漏洞,而是利用了Trivy访问包含暴露密钥的环境变量的权限。 受损的二进制文件通过流行的GitHub Actions(trivy-action和setup-trivy)传播,影响了数百万个流水线。现有的密钥管理工具(Vault、AWS、Doppler等)效果不佳,因为它们在运行时检索密钥,使其暂时以明文形式可用——这正是恶意软件的目标。 VaultProof通过采用“分密钥”架构提供了一种解决方案。它不是暴露完整的密钥,而是分发加密份额,确保环境中不存在明文密钥。即使使用像Trivy这样受到破坏的工具,也没有任何东西可以被窃取,从而完全破坏了攻击模型。这凸显了保护*使用中*的密钥,而不仅仅是静态密钥的解决方案的必要性。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Trivy 供应链攻击如何从密钥管理器中窃取凭据 (vaultproof.dev) 7 分,来自 Rial_Labs 1 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 帮助 Rial_Labs 1 小时前 [–] 作者在此。在分析 Trivy 攻击后构建了 VaultProof。 凭据窃取之所以有效,是因为密钥在从密钥管理器检索后,以明文形式存在于 CI/CD 环境中。如果需要,我很乐意深入探讨 Shamir 架构或攻击机制。回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

What happened

The anatomy of the attack

On March 19, 2026, Aqua Security's Trivy — one of the most widely used vulnerability scanners in the world — was compromised. Attackers injected credential-harvesting logic directly into the official release binary.

The payload was sophisticated: scans appeared to complete and pass normally. The credential exfiltration ran silently alongside legitimate functionality. Teams had no indication anything was wrong.

The attack didn't need to find a vulnerability in your code. It exploited the fact that your CI/CD pipeline runs tools with access to your environment — and your API keys live in that environment as plaintext strings.

This is the supply chain attack model that makes traditional secrets management insufficient: if the key exists as a plaintext string anywhere in your runtime environment, a compromised tool can find and exfiltrate it.

ENTRY POINT

Attacker compromises Trivy release

Exploits mutable Git tags and self-declared commit identity to inject malware into official v0.69.4 release binary.

PROPAGATION

GitHub Actions pick up the payload

Both trivy-action and setup-trivy GitHub Actions are simultaneously compromised. Millions of CI/CD pipelines now run malicious code.

EXFILTRATION

Credentials harvested from runtime environment

The malicious payload accesses plaintext API keys from environment variables — exactly where every secrets manager places them after retrieval. Keys sent to attacker C2 server.

WHERE VAULTPROOF BREAKS THE CHAIN

No plaintext key exists to steal

With VaultProof, the full API key never exists in the CI/CD environment. Only cryptographic shares are present — individually useless to an attacker. Nothing to harvest.

The blind spot

Why your secrets
manager didn't help

Every secrets manager available in March 2026 — Vault, AWS Secrets Manager, Doppler, Infisical — follows the same retrieval model. You store the key encrypted. Your CI/CD pipeline retrieves it via API at runtime. The key becomes a plaintext environment variable that your tools can read.

This is intentional. It's how these tools are designed. They protect the key at rest — not in use.

ci-pipeline.yml (simplified)
$ doppler run -- npm test
# Doppler retrieves OPENAI_API_KEY from vault...
# Sets it as environment variable...
export OPENAI_API_KEY=sk-proj-Ab3xK9mNpQ...

# ↑ Plaintext. In the environment.
# Every tool this pipeline runs can read it.
# Including a compromised Trivy binary.

Running tests...
Running Trivy scan...
OPENAI_API_KEY exfiltrated to 185.220.101.x
✓ Trivy scan passed (0 vulnerabilities found)

The Trivy malware didn't need to find a vulnerability. It just read what was already there. Your secrets manager did exactly what it was designed to do — and the attacker still got the key.

The solution

What would have
stopped this

The only complete defense against a supply chain attack targeting credentials is to ensure the credential doesn't exist as plaintext in the environment at any point.

VaultProof uses split-key architecture to divide API keys into cryptographic shares. Your CI/CD pipeline never has the full key — only shares. Even if a compromised tool reads every byte of the environment, it finds nothing useful.

🔑

Key Registration

Your API key is split into N shares. Distributed to separate storage. Each share is individually useless.

🛡️

Runtime Request

Your app requests the API call. VaultProof proxy collects shares, reconstructs key in memory for milliseconds only.

Call Complete

API call succeeds. Reconstructed key is zeroed from memory. No plaintext key was ever in your app environment.

If Trivy was running during this process, it would find nothing. There is no credential to harvest. The attack model breaks entirely when the key doesn't exist in the runtime environment.

联系我们 contact @ memedata.com