That’s how AWS CLI-style profiles can become a silent path to privilege escalation. The AWS CLI is a powerful tool for managing cloud infrastructure, but profile configurations aren’t just convenience—they’re potential weapons if misused. Many organizations use multiple profiles for different accounts, teams, or roles. The risk begins when credentials for higher-privilege accounts sit side by side with low-privilege ones, without separation or controls.
When a developer’s machine stores access keys for both a test environment and a production admin account, a compromised low-privilege profile can be a launchpad. An attacker can check ~/.aws/credentials and ~/.aws/config for profile names like admin, prod, or root, then run aws sts assume-role or aws configure --profile targetProfile. If MFA isn’t enforced or role trust policies are too broad, privilege escalation becomes trivial.
Misconfigured IAM roles add another layer of danger. If profiles connect to accounts where cross-account trust is allowed without strict conditions, even a role intended for automation can open a door to full admin access. Short-lived session tokens aren’t a complete shield either—attackers with access to valid env vars can pivot quickly.