Toutes les vulnérabilités
HIGHInfraransomware

CLOUD-ENVFILE-EXTORTION-2024

Cloud · AWS · Exposed web servers / AWS IAM

Résumé

On August 15, 2024, Palo Alto Networks Unit 42 detailed a large-scale extortion campaign that compromised cloud environments by harvesting exposed environment variable files. Attackers scanned at least 110,000 domains and collected over 90,000 unique variables, including roughly 7,000 cloud service credentials and 1,515 social media credentials, with their infrastructure probing around 230 million targets. The vector was a web server misconfiguration: .env files inside the web root were served as plaintext over HTTP because the servers had no rule denying access to dotfiles, exposing the long-lived AWS IAM access keys hardcoded inside. The initial IAM principals lacked full admin but retained permission to create roles and users, so attackers called CreateRole and attached AdministratorAccess to escalate, then spun up Lambda functions across regions to automate further internet-wide scanning. They used the victims' own AWS accounts to exfiltrate and delete S3 objects, then uploaded ransom notes demanding payment. The failure chain combined exposed dotfiles, long-lived hardcoded credentials, and over-permissioned IAM, not any cloud-provider flaw.

Comment l’éviter dans votre code

  • Configure web servers to deny all access to dotfiles so .env is never served over HTTP.
  • Keep secrets out of files in the web root; load credentials from a secrets manager at runtime.
  • Replace long-lived IAM access keys with short-lived roles or IAM Identity Center sessions.
  • Deny iam:CreateRole, iam:CreateUser, and policy-attachment actions to application principals via least privilege.
  • Alert on anomalous CreateRole, AttachRolePolicy, and Lambda creation events in CloudTrail.

Références

Vulnérabilités liées

Tout Infra →