A potential risk in the cloudFrontExtensionsConsole which can be used to privilege escalation.
The CloudFront Extensions Console application deployed Lambda functions whose shared IAM roles had excessive permissions, including the ability to create and attach IAM policies. A malicious user could leverage these permissions to escalate their privileges, potentially gaining full administrator access to the AWS account.
Originally disclosed on HackerOne
- Fixed in 12 days
- Disclosed after 24 days
Summary by the researcher
A potential risk in the cloudFrontExtensionsConsole which can be used to privilege escalation.
The report
Summary: I found a potential risk in the cloudFrontExtensionsConsole when I deployed it in the awslabs repository on GitHub. The application created functions and the roles of the functions had too many excessive permissions. A malicious user could leverage these permissions to escalate his/her privilege in multiple ways.
Description: First, the cloudFrontExtensionsConsole application created four functions that are cf_config_version_exporter, cf_config_version_manager, cf_config_version_manager_graphql, and cloudFrontExtensionsConso-SingletonLambdaf7d4f7304-ZbLF9YFgQ4eq rLambdaFunction. These functions share the same role which is cloudFrontExtensionsConso-CloudFrontConfigVersionCo-rAgdktzDTPRh. The role has the "iam:CreateRole", "iam:GetRole", "iam:CreatePolicy", and "iam:AttachRolePolicy" for "*" resources. A malicious user could leverage these permissions to escalate his/her privilege in multiple ways. For example, he/she can leverage the AttachRolePolicy permission to attach the AWS-managed policy or the policy created by the CreatePolicy to the role that he/she can access. It could allow a user to gain full administrator access to the AWS account.
Second, the cloudFrontExtensionsConsole application also created two functions that are cloudFrontExtensionsConso-RepoConstructSyncExtensi-ydrYwNGQCoFr and cloudFrontExtensionsConso-RepoConstructExtDeployer-1uHGWxrjog9S. These two functions share the same role which is cloudFrontExtensionsConso-RepoConstructExtDeployerR-wBEukYirZfbr. The role has the "iam:" for "" resources. These permissions can be exploited in more ways, including but not limited to the attack methods mentioned above.
In a word, the functions created by the cloudFrontExtensionsConsole have too many excessive permissions, which could cause very serious consequences.
Remediation Instructions
- Use finer-grained authorization roles to replace the way that many functions share one role. And use the specific resource names to replace the "*".
- The permissions for IAM resources should be removed if they do not affect normal functionality.
- Add a permissions boundary to restrict the permission.
Impact
Summary:
A malicious user could leverage these permissions to escalate his/her privilege.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application's Lambda functions shared IAM roles with overly broad permissions, including iam:CreateRole, iam:CreatePolicy, and iam:AttachRolePolicy on all resources, instead of fine-grained, least-privilege roles.
Impact
A malicious user could escalate their privileges, potentially gaining full administrator access to the AWS account.
What the attacker needed
A malicious user able to leverage the functions' permissions
The fix
The application should use finer-grained authorization roles with specific resource names instead of wildcards, remove unnecessary IAM permissions, and add a permissions boundary.
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 report has not been written yet. The Original tab links to the source.
This report is about a cloud application that was given too much power by mistake. The application's functions could create and change permissions for other users, so someone who got control of those functions could give themselves full control of the whole cloud account.
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.