CVE-2026-33634 Microsoft Sentinel · KQL

Detect Aquasecurity Trivy Embedded Malicious Code (CVE-2026-33634) in Microsoft Sentinel

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

Tactic
Initial Access Execution Persistence Exfiltration

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let trivyProcesses = DeviceProcessEvents
| where FileName in~ ("trivy", "trivy-linux-amd64", "trivy-linux-arm64") or ProcessCommandLine has "trivy"
| project DeviceId, DeviceName, InitiatingProcessId, ProcessId, FileName, ProcessCommandLine, AccountName, Timestamp;
let suspiciousChildren = DeviceProcessEvents
| where InitiatingProcessFileName in~ ("trivy", "trivy-linux-amd64", "trivy-linux-arm64")
| where FileName !in~ ("trivy", "sh", "bash") or ProcessCommandLine has_any ("curl", "wget", "nc", "ncat", "python", "python3", "perl", "ruby", "bash -i", "/dev/tcp", "base64")
| project DeviceId, DeviceName, InitiatingProcessId, ProcessId, FileName, ProcessCommandLine, AccountName, Timestamp;
let suspiciousNetwork = DeviceNetworkEvents
| where InitiatingProcessFileName in~ ("trivy", "trivy-linux-amd64", "trivy-linux-arm64")
| where RemotePort !in (443, 80, 8080) or RemoteUrl !has "aquasecurity" and RemoteUrl !has "ghcr.io" and RemoteUrl !has "github.com"
| project DeviceId, DeviceName, InitiatingProcessId, RemoteIP, RemotePort, RemoteUrl, InitiatingProcessCommandLine, Timestamp;
let suspiciousFiles = DeviceFileEvents
| where InitiatingProcessFileName in~ ("trivy", "trivy-linux-amd64", "trivy-linux-arm64")
| where FolderPath has_any ("/tmp", "/var/tmp", "/dev/shm", "C:\\Windows\\Temp", "C:\\Users\\Public")
| project DeviceId, DeviceName, InitiatingProcessId, FileName, FolderPath, SHA256, Timestamp;
union suspiciousChildren, (suspiciousNetwork | extend FileName = "", ProcessCommandLine = InitiatingProcessCommandLine, AccountName = ""), (suspiciousFiles | extend ProcessCommandLine = "", AccountName = "")
| order by Timestamp desc
critical severity high confidence

Detects anomalous child process spawning, unexpected external network connections, and suspicious file writes originating from Trivy processes, which may indicate a backdoored or trojanized Trivy binary (CVE-2026-33634).

Data Sources

Microsoft Defender for EndpointMicrosoft Sentinel

Required Tables

DeviceProcessEventsDeviceNetworkEventsDeviceFileEvents

False Positives & Tuning

  • Trivy updating its vulnerability database to non-standard mirrors configured by the operator
  • Legitimate shell wrappers or CI scripts that invoke trivy with bash/sh as a parent
  • Security tooling or EDR agents spawning from trivy's process tree during scan operations
  • Custom Trivy plugins that perform network calls to internal artifact registries

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Last updated: 2026-06-19 Research depth: standard
References (2)

Unlock Pro Content

Get the full detection package for CVE-2026-33634 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections