Skip to content
Access control Write-up Advanced

Group Injection in aws-iam-authenticator: RBAC Privilege Escalation via {{SessionName}}

The aws-iam-authenticator renders the attacker-controlled RoleSessionName into Kubernetes group names when {{SessionName}} is used in groups[], without validating reserved prefixes. An attacker with sts:AssumeRole on a mapped role could set a session name matching an elevated group and gain that group's permissions.

sachinpatilsp Follow

Published on medium.com

aws-iam-authenticator is the security bridge between AWS IAM and Kubernetes RBAC. Many EKS clusters use it — or the recommended replacement, EKS Access Entries — to translate AWS identities into Kubernetes permissions.

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 groups[] array is rendered from user-controlled input without the reserved-prefix validation that is applied to the username field.

Impact

An attacker with sts:AssumeRole on a mapped role could read kube-system secrets and create workloads there, but only if an admin used {{SessionName}} in groups[] and bound that group to elevated permissions; AWS STS blocks colons so system:masters cannot be injected.

What the attacker needed

Legacy aws-iam-authenticator cluster; {{SessionName}} in groups[]; binding to a colon-free elevated group; sts:AssumeRole on the mapped role

The fix

AWS updated the EKS documentation with a warning; the author argued for extending ReservedPrefixExists() to groups[] in the upstream code.

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 groups to decide what a user can do. This tool turns an AWS role session name into a Kubernetes group name. If an admin puts a placeholder for the session name in the group list, an attacker can choose a session name that matches a powerful group and get its permissions.

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.