OWASP Top 10Long read

Security Misconfiguration in AWS IAM Policies and S3 Buckets

Misconfigurations in IAM roles and S3 buckets remain the source of most cloud breaches.

Columnist · · 8 min read
Cover illustration for “Security Misconfiguration in AWS IAM Policies and S3 Buckets”
OWASP Top 10 · September 23, 2026 · 8 min read · 1,813 words

Cloud security failures almost never trace back to Amazon Web Services itself. Gartner projects that by 2025, 99% of cloud security failures will be the customer's fault, and misconfiguration is the reason why. AWS builds the tools. What a company does with IAM policies and S3 buckets is on them, and the shared responsibility model draws that line in plain terms: infrastructure is Amazon's job, configuration is yours. Most companies treat that line as a legal footnote instead of an engineering mandate, and that gap is exactly where breaches happen.

How IAM policies become misconfigured

Most IAM disasters start with the same shortcut. Someone needs a user or service to do a task, and instead of writing a policy scoped to that task, they attach a fully permissive built-in policy that grants unrestricted access to everything in the account. It works immediately. Nobody has to think about which permissions the job actually needs, and the ticket closes. That convenience is what an attacker counts on later. It's the single most avoidable mistake in cloud security, and it's still the most common one.

Least privilege sounds simple as a principle. In practice it's brutal to maintain at scale, which is how enterprises end up running more than 1,000 IAM roles with overlapping, excessive permissions nobody has audited in months. IBM's Cost of a Data Breach Report found that 16% of cloud-related breaches came down to misconfigured IAM settings. Those breaches repeatedly trace back to default roles nobody bothered to tighten.

Default roles deserve more blame than they get. AWS services like SageMaker, Glue, EMR, and Lightsail auto-create or recommend IAM roles during setup, and those roles frequently carry broad permissions that never get reviewed afterward. Nobody sits down and decides a data science notebook should have account-wide S3 access. It just ships that way, and it stays that way, quietly, until someone finds it. An attacker who lands a foothold through one of these defaults doesn't need to work hard. Escalation across services and lateral movement between them opens up fast, and in documented cases a single default role has led to full AWS account takeover.

How SSRF turns an IAM misconfiguration into a full account compromise: the Capital One pattern

Capital One is the reference case: every step in it looks small on its own. Each step deserves a slow walk-through. A misconfigured web application firewall let an attacker exploit a server-side request forgery flaw, and that SSRF flaw reached the EC2 instance metadata service at 169.254.169.254, an internal address every EC2 instance can query for its own configuration data.

The metadata service handed back IAM role credentials attached to the instance. Nothing exotic about that. It's designed to do exactly this. Those credentials were live, valid, and sufficient to reach into S3 and pull data straight out of storage. Roughly 106 million customer records were exposed, and a regulatory fine near $80 million followed.

Follow the chain in order: SSRF vulnerability, then the metadata service, then IAM role credentials, then S3 exfiltration. A firewall misconfiguration. A metadata endpoint doing its job, as designed. A role with permissions someone granted for a legitimate reason years earlier, for a task that probably doesn't even exist anymore. None of these four things is remarkable by itself, but strung together in sequence, they produced one of the largest breaches in financial services history. SSRF is a well-recognized vulnerability class on the OWASP list, and metadata service abuse is a widely documented technique in cloud attack scenarios.

Diagram: The Capital One Breach: Four Steps to 106 Million Records Exposed. Visualizes: Visualize the four-step attack chain that produced the Capital One breach as a linear flow with brief labels at each node: (1) SSRF vulnerability exploited via…

S3 bucket misconfigurations: how data gets exposed, found, and drained

S3 has its own version of this problem, and the trend line hasn't moved in the right direction. Available data indicates that nearly half of all AWS S3 buckets are potentially misconfigured, many left publicly accessible through default or lax settings. More than half of the buckets analyzed held sensitive or personally identifiable information.

Datadog's State of Cloud Security Report put the "effectively public" bucket rate at 1.48%, almost identical to the 1.5% figure from 2023. That flat line is the real story. Public access blocks saw wider adoption over that same stretch, yet the baseline rate of exposed buckets barely moved. Turning a control on isn't the same as configuring it correctly, and the data says most teams stop at the first step and call it done.

Finding an open bucket doesn't take a skilled adversary sitting at a keyboard for hours. Tools like S3Scanner and BucketStream automate the reconnaissance and identify publicly accessible buckets at scale, with zero human review needed on the attacker's end. Once a bucket turns up open, automated exfiltration tools index and drain it rapidly. The exposure window is measured in however long a script takes to finish running. It's measured in however long a script takes to finish running.

What a whitebox pen test finds that automated scanning misses

CSPM tools like AWS Config, Trusted Advisor, and IAM Access Analyzer are genuinely useful for catching static problems, including an overly permissive policy, a missing MFA requirement, and a credential nobody's touched in a year. What they can't do is model a multi-step privilege escalation chain the way a real adversary builds one, and treating them as a substitute for a real test is where most security programs go wrong.

A role that can assume another role, which can read a secret, which can be used to authenticate as a privileged user, looks completely fine at every single step when a scanner checks it in isolation. No individual permission trips an alert. The danger becomes visible only when someone traces the full path from start to finish; a single-resource scan was never built to do that kind of tracing.

Whitebox access is what makes the chain visible. Given access to source code, cloud configuration, and the actual IAM policy documents, a tester can map every role relationship and trust boundary directly, instead of guessing at them from outside the perimeter. That's the real value a skilled manual tester brings: catching business logic flaws, privilege escalation paths stitched together from several individually-permitted steps, and attack vectors that cross straight from the application layer into infrastructure. No automated tool carries that kind of context, because the context lives in how the pieces connect, not in any one piece by itself.

Specific controls that close the IAM and S3 attack surface

Start with credentials, because they're the root of almost everything above. Long-lived static access keys are a frequently recurring thread running through publicly documented cloud breaches. Replace them with temporary credentials issued through IAM roles or AWS Security Token Service, no exceptions carved out for legacy systems that "can't be touched." Build least privilege into role creation from day one instead of accepting whatever a service like SageMaker, Glue, EMR, or Lightsail generates by default. Audit roles and policies on a fixed schedule, since that accumulation of 1,000+ roles per enterprise won't fix itself on its own, and a routine certification workflow catches drift that initial provisioning never will.

A few more controls that matter just as much:

  • Apply Service Control Policies at the AWS Organizations level so individual account admins can't quietly override the boundaries set above them.
  • Turn on MFA everywhere, root accounts especially. Root accounts without MFA represent a critical exposure that security guidance consistently flags as a top priority.
  • Run IAM Access Analyzer and Policy Simulator before deployment, not after, as a preventive check.
  • Migrate every EC2 instance to IMDSv2, which requires session-oriented requests to the metadata service and directly closes the exact vector Capital One's attacker used.

S3 needs its own layer, and Block Public Access is the floor, not the ceiling. Turn it on at the account or organization level, not bucket by bucket, where someone inevitably forgets one. Disable S3 ACLs entirely so access depends only on bucket policy: ACLs are a legacy mechanism and a second permission surface most teams forget even exists, let alone check. Enforce encryption at rest with AWS KMS, and keep strict separation of duties on key policies, so a compute role can use a key without also being able to manage or modify it. Run Amazon Macie to flag sensitive data sitting in buckets and catch unexpected exposure before an outsider does.

Secrets management gets the same treatment. Build secrets scanning, tools like TruffleHog, git-secrets, or GitHub Advanced Security, directly into CI/CD pipelines so hardcoded AWS credentials get caught before they ever reach a repository. If a credential does get committed anyway, treat it as compromised the second it's found. Rotating it after the fact won't help if an automated scanner has already indexed the leak, and one may well have done so very quickly.

How to evaluate whether a pen test found the real IAM and S3 risks

Most organizations buying a penetration test have no real framework for judging whether the report they get back is worth the invoice. A lot of what gets sold as a pen test is automated scanner output with a light coat of human review on top, and some of it doesn't even have that much.

Pay for a report that reads as a documented attack chain of connected findings. Capital One is the proof of why that distinction matters: every step in that chain looked harmless on its own, right up until someone linked them all together. Every critical finding needs proof of exploitation attached to it. A "potential" privilege escalation path with no working proof-of-concept doesn't belong in a report headed for auditors or customers, and a vendor who hands one over anyway is telling you something about how the rest of the test was run.

Coverage matters as much as depth does. If role-to-role assumption chains, SSRF-to-metadata-to-S3 paths, or hardcoded credentials sitting in a repo exist anywhere in the environment, a real test surfaces them. That level of coverage only happens reliably with whitebox access to source code and cloud configuration. Blackbox testing from outside the perimeter cannot map IAM trust relationships or find a secret sitting in a private repo it was never granted access to. Demanding whitebox access is a floor. It's a floor.

Watch for the red flags directly: no working exploit behind a high or critical finding, results that mirror automated scanner output with no sign of manual validation, zero mention of multi-step privilege escalation anywhere in the document, and no retest offered after remediation to confirm the fixes actually held. A test that ends the moment the PDF lands in an inbox hasn't done its job, no matter how many pages it runs.

None of this conflicts with compliance requirements, whatever the common assumption might be. A rigorous whitebox pen test, done properly, satisfies SOC 2, HIPAA, and ISO 27001 while producing findings a technical team can actually act on. Done right, that's one deliverable doing both jobs at once: passing an audit and finding what actually matters.

Filed underOWASP Top 10

More in OWASP Top 10