SOC Prime Bias: Critical

26 Aug 2026 06:51 UTC

Rust Supply Chain Attack Targets arrayref, internment, and append-only-vec

Author Photo
SOC Prime Team linkedin icon Follow
Rust Supply Chain Attack Targets arrayref, internment, and append-only-vec
shield icon

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

Summary

A sophisticated supply-chain attack targeted the Rust ecosystem by compromising a legitimate maintainer account and using a typosquatting identity to inject malicious build-time dependencies. The attackers poisoned three widely used crates, arrayref, internment, and append-only-vec, to execute a remote code execution dropper during the Cargo build process. This enabled silent code execution on developer workstations and CI/CD pipelines during routine compilation.

Investigation

Researchers analyzed the attack using Harden-Runner, which captured the malicious build script attempting an outbound connection to a payload server over port 9089. Forensic review of the crates.io-index Git history revealed targeted insertion of malicious dependencies and a yank-and-upgrade lure designed to push developers toward compromised versions. Researchers also identified secondary persistence mechanisms and C2 behavior reported by affected users.

Mitigation

Immediate mitigation includes pinning legitimate crates to verified safe versions and auditing Cargo.lock files for compromised dependency releases. Organizations should purge local and CI/CD caches, including ~/.cargo/registry/cache, to remove malicious .crate files. Egress filtering for unusual outbound connections from build environments and strict lockfile discipline are also critical long-term defenses.

Response

If affected versions are found in a lockfile, the build environment should be treated as compromised and all accessible credentials, including SSH keys, cloud tokens, and CI/CD secrets, should be rotated. Developer systems should be examined for persistence artifacts such as unauthorized systemd services or suspicious files in configuration directories. All software artifacts produced during the exposure period should be rebuilt from clean, verified sources.

Attack Flow

Detections

Possible Persistence Points [ASEPs – Software/NTUSER Hive] (via registry_event)

SOC Prime Team
21 Aug 2026

Possible C2 Communications Over HTTP To Direct IP With Uncommon Port (via proxy)

SOC Prime Team
21 Aug 2026

Hidden File Was Created On Linux Host (via file_event)

SOC Prime Team
21 Aug 2026

IOCs (HashSha256) to detect: Rust Supply-Chain Attack: arrayref, internment, and append-only-vec Poisoned by the proc-macro1 Build-Time Dropper

SOC Prime AI Rules
21 Aug 2026

IOCs (SourceIP) to detect: Rust Supply-Chain Attack: arrayref, internment, and append-only-vec Poisoned by the proc-macro1 Build-Time Dropper

SOC Prime AI Rules
21 Aug 2026

IOCs (DestinationIP) to detect: Rust Supply-Chain Attack: arrayref, internment, and append-only-vec Poisoned by the proc-macro1 Build-Time Dropper

SOC Prime AI Rules
21 Aug 2026

Anomalous Outbound Network Connection Detection [Windows Network Connection]

SOC Prime AI Rules
21 Aug 2026

Execution of Malicious PowerShell and VBScript in Rust Supply-Chain Attack [Windows Powershell]

SOC Prime AI Rules
21 Aug 2026

Execution of Suspicious Build Process in Unix Temp Directory [Linux Process Creation]

SOC Prime AI Rules
21 Aug 2026

Simulation Execution

Prerequisite: The Telemetry & Baseline Pre-flight Check must have passed.

Rationale: This section details the precise execution of the adversary technique (TTP) designed to trigger the detection rule. The commands and narrative MUST directly reflect the TTPs identified and aim to generate the exact telemetry expected by the detection logic. Abstract or unrelated examples will lead to misdiagnosis.

  • Attack Narrative & Commands: The adversary has successfully injected a malicious crate into a Rust project. When the build process is initiated, the build.rs script executes a background thread that attempts to establish a connection to a remote C2 server on port 9089 to fetch a payload. This simulates the “Anomalous Outbound Network Connection” described in the rule. The goal is to trigger the firewall/network log alert by hitting the specific port 9089.

  • Regression Test Script:

    # Simulate a build-time dropper attempting to connect to a C2 server on port 9089
    # We use a TCP client to simulate the network connection attempt.
    
    $C2_IP = "127.0.0.1" # Localhost to avoid actual external traffic during testing
    $C2_PORT = 9089
    
    Write-Host "Simulating build process network activity..." -ForegroundColor Cyan
    try {
        $client = New-Object System.Net.Sockets.TcpClient
        $beginConnect = $client.BeginConnect($C2_IP, $C2_PORT, $null, $null)
        $success = $beginConnect.AsyncWaitHandle.WaitOne(1000, $false)
    
        if ($success) {
            Write-Host "Connection successful! Telemetry should be generated." -ForegroundColor Green
            $client.EndConnect($beginConnect)
        } else {
            Write-Host "Connection failed (expected if no listener is active), but telemetry should still show the attempt." -ForegroundColor Yellow
        }
        $client.Close()
    } catch {
        Write-Host "Error during simulation: $($_.Exception.Message)" -ForegroundColor Red
    }
  • Cleanup Commands:

    # No persistent changes made by the script; however, ensure any local listeners are stopped.
    # If a listener was started for testing, use:
    Stop-Process -Name "nc" -ErrorAction SilentlyContinue
    Write-Host "Cleanup complete." -ForegroundColor Green