Skip to content
Access control Write-up Advanced

The Confused Deputy in the AWS Cloud: Bypassing Kubernetes NodeRestriction via IAM Spoofing

The aws-iam-authenticator's validation of user-controlled identity claims relies on permissive pattern matching, allowing an attacker with a low-privilege worker node to spoof a high-value node's identity. This bypasses NodeRestriction, enabling secret exfiltration and potential cloud infrastructure takeover via IRSA.

sachinpatilsp Follow

Published on medium.com

In modern cloud-native environments, the intersection of Cloud Identity and Access Management (IAM) and Kubernetes Role-Based Access Control (RBAC) creates complex security boundaries. Amazon EKS relies on the aws-iam-authenticator to securely translate AWS IAM identities into Kubernetes RBAC contexts.

Sachin Patil, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the aws-iam-authenticator uses an excessively permissive pattern-matching routine to validate user-controlled identity claims, without strict format boundaries or cryptographic binding to the requesting hardware.

Impact

An attacker who has compromised a low-privilege worker node could bypass NodeRestriction, read secrets restricted to other nodes, and potentially pivot to the broader AWS cloud via IRSA, but this depends on an overly permissive IAM trust policy.

What the attacker needed

Code execution on a low-privilege worker node; overly permissive IAM role trust policy

The fix

The documentation was updated to warn that template variables are only safe when the role trust policy is strictly scoped to the ec2.amazonaws.com service principal.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Kubernetes uses a component called aws-iam-authenticator to check who is making requests. This report says that if an attacker can control certain input, the authenticator can be tricked into believing the attacker is a different, more important machine. That lets the attacker steal secrets and possibly take over cloud resources.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by sachinpatilsp

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.