Back to Intelligence

UNC6426 Breaches AWS Admin via nx npm Supply Chain in Just 72 Hours

SA
Security Arsenal Team
March 11, 2026
6 min read

UNC6426 Breaches AWS Admin via nx npm Supply Chain in Just 72 Hours

The modern software supply chain is a battlefield, and a recent incident involving the nx npm package demonstrates just how quickly a compromise can escalate into a full-blown cloud infrastructure breach. Security researchers tracking the threat actor UNC6426 have uncovered a disturbingly efficient attack chain: from a compromised open-source library to administrative access over a victim's AWS environment in a mere 72 hours.

This incident serves as a stark reminder that a vulnerability in a build tool can easily translate into a catastrophic identity compromise in the cloud.

The Attack Chain: From Dependency to Domain Admin

The attack leveraged the supply chain compromise of the nx package, a popular toolkit for Javascript/TypeScript monorepos. While the initial compromise of the package occurred previously, UNC6426 utilized stolen credentials obtained during that incident to launch a secondary, highly targeted attack.

The sequence of events highlights a critical blind spot in many DevSecOps pipelines:

  1. Initial Access via CI/CD: The threat actor utilized a GitHub token that was leaked or stolen following the initial npm package compromise. In modern CI/CD environments, GitHub tokens often have extensive permissions to clone repositories, push code, and trigger workflows.
  2. Privilege Escalation: Instead of simply planting malicious code, UNC6426 weaponized the trust inherent in the GitHub token. They used it to access private repositories belonging to the victim.
  3. Cloud Pivot: The ultimate goal was not the source code itself, but the secrets buried within it. By accessing the infrastructure-as-code or configuration files stored in these private repos, the actor located AWS credentials.
  4. Data Exfiltration: With valid AWS credentials in hand, the threat actor moved laterally into the cloud environment, escalating privileges to gain admin-level access and initiating data exfiltration.

The 72-hour timeframe is particularly alarming. It suggests an automated or highly manual process where the actor rapidly triaged the stolen token to find high-value targets (cloud secrets) rather than wasting time on low-value assets.

Technical Analysis & TTPs

UNC6426's tactics, techniques, and procedures (TTPs) align with a growing trend of "living off the land" in the cloud. Rather than exploiting a zero-day vulnerability in AWS, they abused legitimate credentials.

  • Initial Vector: Supply Chain Poisoning (npm package).
  • Credential Theft: Harvesting GITHUB_TOKEN or similar CI/CD secrets.
  • Discovery: Scanning private repos for strings matching AWS key patterns (e.g., AKIA...).
  • Execution: Using the AWS CLI or SDK with stolen keys to enumerate S3 buckets and IAM policies.

The critical failure point here is often the excessive permissions granted to CI/CD tokens. If the token used to run tests or build the nx project had read access to infrastructure repos, the entire cloud estate was effectively exposed.

Detection and Threat Hunting

Detecting this type of attack requires looking beyond the endpoint. You must correlate identity activity across your source control management (GitHub/GitLab) and your cloud provider (AWS).

1. Hunt for Compromised nx Packages (Bash)

First, determine if your environment is currently using a vulnerable version of the nx package that may be part of this supply chain wave.

Script / Code
# Recursively search package-lock. or yarn.lock files for the nx package
# This helps identify potentially compromised dependencies in your codebase.

if command -v grep &> /dev/null; then
  echo "Scanning for nx package references..."
  grep -rn '"nx"' --include="package-lock." --include="yarn.lock" .
else
  echo "grep not found. Please install to run this scan."
fi

2. Identify GitHub Token Usage Anomalies (KQL)

Use this KQL query in Microsoft Sentinel or a similar SIEM to detect GitHub tokens (often identified by the actor or specific user-agent strings) accessing private repositories they haven't touched before, or accessing them from anomalous IP locations.

Script / Code
// Detect anomalous GitHub PAT or App Token usage
GithubAuditLog
| where Operation in ("git.clone", "repo.read", "repo.get")
| where RepoIsPublic == false
| summarize StartTime=min(TimeGenerated), EndTime=max(TimeGenerated), Count=count() by Actor, RepoName, IpAddress
| join kind=anti (
    // Baseline: normal access patterns in the last 30 days
    GithubAuditLog
    | where TimeGenerated > ago(30d)
    | summarize NormalCount=count() by Actor, RepoName
) on Actor, RepoName
| where isnull(NormalCount) or Count > (NormalCount * 2)
| project StartTime, EndTime, Actor, RepoName, IpAddress, Count

3. Detect AWS IAM Anomalies from New Sources (Python)

This Python script utilizes the AWS SDK (boto3) to parse CloudTrail logs for ConsoleLogin or critical API calls made by IAM users that have not been seen in the last 60 days.

Script / Code
import boto3
from datetime import datetime, timedelta

def detect_new_iam_accessors():
    client = boto3.client('cloudtrail')
    start_time = datetime.utcnow() - timedelta(hours=72)
    end_time = datetime.utcnow()
    
    # Look for high-risk events
    events = client.lookup_events(
        LookupAttributes=[
            {'AttributeKey': 'EventName', 'AttributeValue': 'ConsoleLogin'},
        ],
        StartTime=start_time,
        EndTime=end_time
    )
    
    print("Checking for IAM users with recent logins but no history...")
    
    # In a real scenario, you would compare this against a long-term baseline
    # This snippet highlights the logic for finding the events
    for event in events['Events']:
        username = event.get('Username')
        event_time = event.get('EventTime')
        event_name = event.get('EventName')
        source_ip = event.get('SourceIPAddress')
        
        print(f"ALERT: User {username} performed {event_name} from {source_ip} at {event_time}")

if __name__ == "__main__":
    detect_new_iam_accessors()

Mitigation Strategies

To defend against this specific supply chain-to-cloud attack vector, organizations must adopt a "zero trust" approach to their development and cloud infrastructure.

  • Least Privilege for CI/CD: revoke the default permissions for GitHub Actions or CI pipelines. Use specific, scoped permissions (e.g., contents: read for a specific repo) rather than granting access to all repositories.

  • Implement OIDC (OpenID Connect): Stop storing long-lived AWS credentials (Access Keys/Secret Keys) in GitHub repository secrets. Use OIDC to allow your CI/CD provider to request a short-lived token from AWS for a specific role. This prevents a repo compromise from revealing static credentials.

  • Rotate Keys Immediately: If you used the nx package during the compromise window, assume your GitHub tokens and potentially any AWS keys stored in your repos are exposed. Rotate them immediately.

  • Branch Protection Rules: Enforce strict branch protections that require pull request reviews. UNC6426 often tries to push malicious commits directly; requiring a second pair of human eyes can stop the injection.

  • Secret Scanning: Enable secret scanning on your GitHub repositories. This automatically prevents API keys or tokens from being committed to the repository in the first place.

Conclusion

The UNC6426 attack is a textbook example of the "cascade effect" in modern cybersecurity. A single compromised npm package created a foothold that allowed an attacker to steal identity tokens, access private code, and hijack a cloud environment. Speed is of the essence; the 72-hour turnaround means that by the time a traditional alert is generated, the attacker may already be gone with your data.

Related Resources

Security Arsenal Incident Response Services AlertMonitor Platform Book a SOC Assessment incident-response Intel Hub

incident-responseransomwareforensicssupply-chainaws-securitynpmunc6426threat-hunting

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.