Trivy供应链攻击
Supply Chain Attack on Trivy

原始链接: https://www.wiz.io/blog/trivy-compromised-teampcp-supply-chain-attack

## Trivy 供应链攻击 – 摘要 2026年3月,Aqua Security 的 Trivy 漏洞扫描器遭到了一次重大的供应链攻击。威胁行为者,名为 TeamPCP,通过先前事件中保留的权限,入侵了 Trivy 的核心扫描器和 GitHub Actions (trivy-action 和 setup-trivy)。 攻击者将窃取凭证的恶意软件注入到官方发布版本和 GitHub Actions 中,并将恶意镜像发布到 Docker Hub。该恶意软件会从 Runner.Worker 进程中收集机密信息(SSH 密钥、云凭证、Kubernetes 令牌),并尝试通过一个打字错误域名或备用 GitHub 仓库 ("tpcp-docs") 将其泄露。该恶意软件还尝试在开发人员机器上保持持久性。 Aqua 已经移除了恶意制品,但建议使用 Trivy 的组织**立即审计其环境**,检查是否存在受损版本(特别是 v0.69.4)并审查 GitHub Action 引用。建议将 GitHub Actions 固定到特定的 SHA 哈希值,而不是版本标签,以防止未来的利用。Wiz 为客户提供了评估风险的资源。

最近一次供应链攻击的目标是Trivy,一种流行的漏洞扫描器。一个恶意版本的Trivy被推送到GitHub Actions,可能危及依赖于社区维护action的用户。 Hacker News上的讨论强调了自托管和手动安装工具(如Trivy)的好处,使用类似`curl | sh`的方法并固定版本。这种方法允许用户避免潜在的受损或臃肿的社区action,并保持对其安全工具的更大控制权。 用户们讨论了GitHub Actions和runners之间的区别,明确了可以使用默认runners *无需* 社区action,或者自托管runners *使用* 它们。核心要点是优先考虑控制并验证软件来源,以减轻供应链风险。
相关文章

原文

On March 19, 2026, threat actors compromised Aqua Security's Trivy vulnerability scanner, injecting credential-stealing malware into official releases and GitHub Actions. While Aqua reports they have since removed the malicious releases, organizations using Trivy should audit their environments immediately. 

Update March 22, 13:15 UTC: Wiz Research continues to track TeamPCP activity following the initial Trivy compromise. The threat actor has expanded operations to the npm ecosystem via a worm ("CanisterWorm") leveraging stolen publish tokens. Additionally, the ICP-hosted fallback C2 (tdtqy-oyaaa-aaaae-af2dq-cai) is now actively serving an iteratively developed payload (kamikaze.sh). Aqua has published blog post and GitHub Security Advisory.

Update March 22, 21:40 UTC: ~16:00 UTC, attackers were able to publish malicious images of Trivy (0.69.5, 0.69.6) to Docker Hub. The attacker has also demonstrated continued access to Aqua by publishing internal Aqua repositories publicly on GitHub. As of 21:31 UTC, the IPC Canister has been made "Unavailable Due to Policy Violation." We continue to monitor the situation.

Note:
this incident is distinct from the previous instance earlier this month, where hackbot-claw exploited a PWN request. Customers can refer to the Threat Center Advisory on the previous incident.

What happened?

Wiz Research, in concert with other industry parties, identified a multi-faceted supply chain attack targeting Aqua Security's Trivy. The attack compromised multiple components of the Trivy project: the core scanner, the trivy-action GitHub Action, and the setup-trivy GitHub Action.

The attack was conducted with access retained following incomplete containment of the earlier incident.

The threat actor, self-identifying as TeamPCP, made imposter commits that were pushed to actions/checkout (while spoofing user rauchg) and to aquasecurity/trivy (while spoofing user DmitriyLewen). At 17:43:37 UTC, the Trivy repository’s v0.69.4 tag was pushed, triggering a release. This resulted in a malicious checkout that fetched credential stealer code from a typosquatted domain (scan.aquasecurtiy[.]org, resolving to 45.148.10.212), and backdoored binaries being published to GitHub Releases, Docker Hub, GHCR, and ECR. The maintainers have since removed these malicious artifacts.

The attacker also compromised the aqua-bot service account and then abused their access push malicious workflows to tfsec, traceeshark, and trivy-action and steal additional credentials from Aqua (including GPG keys and credentials for Docker Hub, Twitter, and Slack). These secrets were exfiltrated to a Cloudflare Tunnel C2 (plug-tab-protective-relay.trycloudflare.com). Furthermore, 75 out of 76 trivy-action tags were force-pushed to malicious versions, and 7 setup-trivy tags were force-pushed as well. 

The malicious versions of these Actions run a tool self-described as "TeamPCP Cloud stealer", which dumps Runner.Worker process memory, harvests SSH, cloud, and K8s secrets, encrypts the data (using AES-256+RSA-4096), and exfiltrates it to a remote server. The malware is configured to create a repository named tpcp-docs in the victim's GitHub account as a fallback method.

What did the malicious GitHub workflows do?

The attacker injected the same three-stage payload into both trivy-action (in entrypoint.sh) and setup-trivy (in action.yaml). When a downstream workflow executed either action, the payload ran on the victim's GitHub Actions runner:

  1. Collection: The malware scraped memory from the Runner.Worker process by reading /proc/<pid>/mem and searching for the pattern {"value":"<secret>","isSecret":true}. It also swept the filesystem for SSH keys, cloud credentials  (AWS, GCP, Azure), Kubernetes tokens, and cryptocurrency wallets across 50+ sensitive file paths.

  2. Encryption: Harvested credentials were encrypted using AES-256-CBC with RSA-4096 hybrid encryption and bundled into tpcp.tar.gz

  3. Exfiltration: The malware transmitted the encrypted bundle to a typosquatted domain (scan.aquasecurtiy[.]org). As a fallback, it could create a tpcp-docs repository in the victim's GitHub account and upload the stolen credentials  as a release asset.

What did the malicious Trivy binary (v0.69.4) do?

When the malicious binary is executed it starts both the legitimate trivy service and the malicious code in parallel. In our initial analysis the malicious code exfiltrates secrets with a primary and backup mechanism. If it detects it is on a developer machine it additionally writes a base64 encoded python dropper for persistence.

Data Theft

The malicious process gathers environmental variables, sweeps the system for any credentials stored in the filesystem and enumerates the network interface. It then compresses and encrypts the data and attempts to exfiltrate it via post request to https://scan.aquasecurtiy[.]org. If that fails (returns a non-2xx status code), the malware then attempts to use a stolen GITHUB_TOKEN to create a repo tpcp-docs and post the data there. 

Set Persistence

The malicious code attempts to identify if it is on a developer machine by checking if the environmental variable GITHUB_ACTIONS != “true”. If that check passes, the malware attempts to create persistence by writing a python script as ~/.config/systemd/user/sysmon.py and creating a systemd unit that persistently runs the python script.

sysmon.py initially sleeps for five minutes and then polls https://tdtqy-oyaaa-aaaae-af2dq-cai.raw.icp0.io/. If a non-youtube link is found there the dropper downloads to /tmp/pglog and executes it in a new session. 

At the time of analysis (10:30 AM EST/15:30 UTC) the malicious site was set to a RickRoll, but it could be changed by the attacker at any time. 

Which actions should security teams take?

  1.  Audit Trivy versions: Check whether your organization pulled or executed Trivy v0.69.4 from any source (GitHub Releases, container registries, etc.). Remove any affected artifacts immediately.

  2.  Audit GitHub Action references: Review workflows using aquasecurity/trivy-action or aquasecurity/setup-trivy. If you referenced a version tag rather than a SHA, check workflow run logs from March 19-20 for signs of compromise. Specifically, you can look in the Run Trivy step of trivy-action and the Setup environment step of setup-trivy.

  3.  Search for exfiltration artifacts: Look for repositories named tpcp-docs in your GitHub organization, which may indicate successful exfiltration via the fallback mechanism. Hunt based on the IOCs provided below.

Long-term hardening: Pin GitHub Actions to full SHA hashes, not version tags. Version tags can be moved to point at malicious commits, as demonstrated in this attack.

How Wiz can help?

Wiz customers should refer to and monitor the advisory in the Wiz Threat Center for ongoing guidance, pre-built queries, and references to relevant detections they can use to assess the risk  in their environment.

Worried you’ve been impacted? Connect with the Wiz Incident Response team.

SITF diagram

Learn more about SITF here.

Indicators of compromise

Network Indicators

IndicatorNotes
scan.aquasecurtiy.orgTyposquatted C2
45.148.10.212TECHOFF SRV LIMITED, Amsterdam
tdtqy-oyaaa-aaaae-af2dq-cai.raw.icp0.ioICP-hosted fallback within malicious Trivy binary
plug-tab-protective-relay.trycloudflare.comUsed within GitHub Actions for exfiltration

Malicious Artifacts

TypeValueDetails
IOC (Hash)887e1f5b5b50162a60bd03b66269e0ae545d0aef0583c1c5b00972152ad7e073FreeBSD-64bit
IOC (Hash)f7084b0229dce605ccc5506b14acd4d954a496da4b6134a294844ca8d601970dLinux-32bit
IOC (Hash)822dd269ec10459572dfaaefe163dae693c344249a0161953f0d5cdd110bd2a0Linux-64bit
IOC (Hash)bef7e2c5a92c4fa4af17791efc1e46311c0f304796f1172fce192f5efc40f5d7Linux-ARM
IOC (Hash)e64e152afe2c722d750f10259626f357cdea40420c5eedae37969fbf13abbecfLinux-ARM64 (unconfirmed)
IOC (Hash)ecce7ae5ffc9f57bb70efd3ea136a2923f701334a8cd47d4fbf01a97fd22859cLinux-PPC64LE
IOC (Hash)d5edd791021b966fb6af0ace09319ace7b97d6642363ef27b3d5056ca654a94cLinux-s390x
IOC (Hash)e6310d8a003d7ac101a6b1cd39ff6c6a88ee454b767c1bdce143e04bc1113243macOS-64bit
IOC (Hash)6328a34b26a63423b555a61f89a6a0525a534e9c88584c815d937910f1ddd538macOS-ARM64
IOC (Hash)0880819ef821cff918960a39c1c1aada55a5593c61c608ea9215da858a86e349Windows-64bit

Malicious Workflows

Credit to Socket for compiling this data and making it easily available at https://socket.dev/supply-chain-attacks/trivy-github-actions-compromise

ActionHash
setup-trivy8afa9b9f9183b4e00c46e2b82d34047e3c177bd0
setup-trivy386c0f18ac3d7f2ed33e2d884761119f4024ff8a
setup-trivy384add36b52014a0f99c0ab3a3d58bd47e53d00f
setup-trivy7a4b6f31edb8db48cc22a1d41e298b38c4a6417e
setup-trivy6d8d730153d6151e03549f276faca0275ed9c7b2
setup-trivy99b93c070aac11b52dfc3e41a55cbb24a331ae75
setup-trivyf4436225d8a5fd1715d3c2290d8a50643e726031
trivy-actionf4f1785be270ae13f36f6a8cfbf6faaae50e660a
trivy-action0891663bc55073747be0eb864fbec3727840945d
trivy-action2e7964d59cd24d1fd2aa4d6a5f93b7f09ea96947
trivy-actionddb9da4475c1cef7d5389062bdfdfbdbd1394648
trivy-action4209dcadeaea6a7df69262fef1beeda940881d4d
trivy-actionf5c9fd927027beaa3760d2a84daa8b00e6e5ee21
trivy-action18f01febc4c3cd70ce6b94b70e69ab866fc033f5
trivy-actionbb75a9059c2d5803db49e6ed6c6f7e0b367f96be
trivy-actiond488f4388ff4aa268906e25c2144f1433a4edec2
trivy-action3c615ac0f29e743eda8863377f9776619fd2db76
trivy-actiona9bc513ea7989e3234b395cafb8ed5ccc3755636
trivy-action8519037888b189f13047371758f7aed2283c6b58
trivy-action8cfb9c31cc944da57458555aa398bb99336d5a1f
trivy-action9092287c0339a8102f91c5a257a7e27625d9d029
trivy-action7b955a5ece1e1b085c12dac7ac10e0eb1f5b0d4d
trivy-action19851bef764b57ff95b35e66589f31949eeb229d
trivy-action61fbe20b7589e6b61eedcd5fe1e958e1a95fbd13
trivy-actionfa78e67c0df002c509bcdea88677fb5e2fe6a9b1
trivy-actionb7befdc106c600585d3eec87d7e98e1c136839ae
trivy-action7f6f0ce52a59bdfc5757c3982aac2353b58f4c73
trivy-actionddb6697447a97198bdef9bae00215059eb5e8bc2
trivy-action3dffed04dc90cf1c548f40577d642c52241ec76c
trivy-actionad623e14ebdfe82b9627811d57b9a39e283d6128
trivy-action848d665ed24dc1a41f6b4b7c7ffac7693d6b37be
trivy-actionddb94181dcbc723d96ffc07fddd14d97e4849016
trivy-actionb7252377a3d82c73d497bfafa3eabe84de1d02c4
trivy-actionfa4209b6182a4c1609ce34d40b67f5cfd7f00f53
trivy-action2b1dac84ff12ba56158b3a97e2941a587cb20da9
trivy-action66c90331c8b991e7895d37796ac712b5895dda3b
trivy-actionfd429cf86db999572f3d9ca7c54561fdf7d388a4
trivy-action8ae5a08aec3013ee8f6132b2a9012b45002f8eaa
trivy-action2a51c5c5bb1fd1f0e134c9754f1702cfa359c3dd
trivy-action9c000ba9d482773cbbc2c3544d61b109bc9eb832
trivy-action91e7c2c36dcad14149d8e455b960af62a2ffb275
trivy-action4bdcc5d9ef3ddb42ccc9126e6c07faa3df2807e3
trivy-action9e8968cb83234f0de0217aa8c934a68a317ee518
trivy-actionc5967f85626795f647d4bf6eb67227f9b79e02f5
trivy-actionb745a35bad072d93a9b83080e9920ec52c6b5a27
trivy-action38623bf26706d51c45647909dcfb669825442804
trivy-action555e7ad4c895c558c7214496df1cd56d1390c516
trivy-action2297a1b967ecc05ba2285eb6af56ab4da554ecae
trivy-action820428afeb64484d311211658383ce7f79d31a0a
trivy-actionf77738448eec70113cf711656914b61905b3bd47
trivy-action252554b0e1130467f4301ba65c55a9c373508e35
trivy-action22e864e71155122e2834eb0c10d0e7e0b8f65aa3
trivy-action405e91f329294fb696f55793203abf1f6aba9b40
trivy-action506d7ff06abc509692c600b5b69b4dc6ceaa4b15
trivy-action276ca9680f6df9016db12f7c48571e5c4639451d
trivy-actionaa3c46a9643b18125abb8aefc13219014e9c4be8
trivy-actionea56cd31d82b853932d50f1144e95b21817e52cf
trivy-action0d49ceb356f7d4735c63bd0d5c7e67665ec7f80c
trivy-action7550f14b64c1c724035a075b36e71423719a1f30
trivy-actionda73ae0790e458e878b300b57ceb5f81ac573b46
trivy-action6ec7aaf336b7d2593d980908be9bc4fed6d407c6
trivy-actioncf19d27c8a7fb7a8bbf1e1000e9318749bcd82cf
trivy-actionef3a510e3f94df3ea9fcd01621155ca5f2c3bf5b
trivy-action6fc874a1f9d65052d4c67a314da1dae914f1daff
trivy-actionb9faa60f85f6f780a34b8d0faaf45b3e3966fdda
trivy-actionab6606b76e5a054be08cab3d07da323e90e751e8
trivy-actiona5b4818debf2adbaba872aaffd6a0f64a26449fa
trivy-actione53b0483d08da44da9dfe8a84bf2837e5163699b
trivy-action8aa8af3ea1de8e968a3e49a40afb063692ab8eae
trivy-action91d5e0a13afab54533a95f8019dd7530bd38a071
trivy-action794b6d99daefd5e27ecb33e12691c4026739bf98
trivy-action9ba3c3cd3b23d033cd91253a9e61a4bf59c8a670
trivy-actione0198fd2b6e1679e36d32933941182d9afa82f6f
trivy-action9738180dd24427b8824445dbbc23c30ffc1cb0d8
trivy-action3201ddddd69a1419c6f1511a14c5945ba3217126
trivy-action985447b035c447c1ed45f38fad7ca7a4254cb668
trivy-action3d1b5be1589a83fc98b82781c263708b2eb3b47b
trivy-actionfd090040b5f584f4fcbe466878cb204d0735dcf4
trivy-action85cb72f1e8ee5e6e44488cd6cbdbca94722f96ed
trivy-actioncf1692a1fc7a47120e6508309765db7e33477946
trivy-action1d74e4cf63b7cf083cf92bf5923cf037f7011c6b
trivy-actionc19401b2f58dc6d2632cb473d44be98dd8292a93

References

联系我们 contact @ memedata.com