Detect Aquasecurity Trivy Embedded Malicious Code (CVE-2026-33634) in Elastic Security
CVE-2026-33634 describes an embedded malicious code vulnerability (CWE-506) in Aquasecurity Trivy, a widely-used open-source vulnerability scanner. A compromised or trojanized Trivy binary may execute attacker-controlled code during container image scanning, CI/CD pipeline runs, or Kubernetes admission checks. Because Trivy is frequently granted elevated permissions to access container registries, Kubernetes API servers, and cloud credential chains, a backdoored instance poses critical supply-chain risk: exfiltration of secrets, lateral movement into CI/CD infrastructure, and persistent implant installation. This detection monitors for anomalous process behavior, unexpected network egress, and suspicious file activity originating from Trivy processes.
MITRE ATT&CK
Elastic Detection Query
sequence by host.name with maxspan=2m
[process where event.type == "start" and
(process.name in ("trivy", "trivy-linux-amd64", "trivy-linux-arm64") or
process.parent.name in ("trivy", "trivy-linux-amd64", "trivy-linux-arm64"))]
[any where event.category in ("network", "file") and
(
(event.category == "network" and
process.name in ("trivy", "trivy-linux-amd64", "trivy-linux-arm64") and
not (destination.port in (443, 80) and
destination.domain in ("aquasecurity.github.io", "ghcr.io", "github.com", "api.github.com")))
or
(event.category == "file" and
process.name in ("trivy", "trivy-linux-amd64", "trivy-linux-arm64") and
file.path like~ "/tmp/*" or file.path like~ "/dev/shm/*" or file.path like~ "/var/tmp/*")
or
(event.category == "process" and
process.parent.name in ("trivy", "trivy-linux-amd64", "trivy-linux-arm64") and
process.name in ("curl", "wget", "nc", "ncat", "python3", "python", "perl", "ruby"))
)
] EQL sequence rule correlating Trivy process start with subsequent suspicious network egress, temp file writes, or interpreter spawning within a 2-minute window — fingerprint of embedded malicious code execution.
Data Sources
Required Tables
False Positives & Tuning
- Trivy running with custom plugin configurations that spawn helper processes
- Scan result exporters writing temporary JSON to /tmp before upload
- Network-connected vulnerability DB fetches to private mirror hosts not in the allowlist
- Containerized Trivy instances where the host name matches multiple scan jobs simultaneously
Other platforms for CVE-2026-33634
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Trivy Binary Hash Verification Failure Simulation
Expected signal: ProcessRollup or DeviceProcessEvents event for /tmp/trivy-test with a SHA-256 hash differing from the official trivy binary hash; file creation event for /tmp/trivy-test.
- Test 2Trivy Spawning Reverse Shell Child Process
Expected signal: ProcessRollup event showing trivy (or trivy-named process) as parent of nc/netcat; NetworkConnect event for local port 14444.
- Test 3Trivy Unexpected Outbound Network Connection
Expected signal: NetworkConnect event from a process named 'trivy' (via exec -a) to 169.254.169.254 port 80; DnsRequest or direct IP connection telemetry.
- Test 4Trivy Writing Dropper to Temp Directory
Expected signal: FileCreate event showing a trivy-named process writing an executable file to /dev/shm/; file hash and permissions captured in endpoint telemetry.
Unlock Pro Content
Get the full detection package for CVE-2026-33634 including response playbook, investigation guide, and atomic red team tests.