Exploiting AWS Service Vulnerabilities for Initial Access
This talk demonstrates how to exploit misconfigured IAM role trust policies in AWS services like AppSync and Amplify to gain unauthorized initial access. The speaker highlights the danger of 'confused deputy' attacks where an attacker can coerce a service into assuming a victim's IAM role. The presentation provides practical guidance on auditing IAM trust policies and using condition keys to prevent cross-account and cross-tenant exploitation. The research includes a demonstration of using Sourcegraph to identify vulnerable roles in public GitHub repositories.
Exploiting AWS Service Trust Policies: The Confused Deputy in Your Cloud
TLDR: Many AWS services rely on IAM role trust policies to perform actions on your behalf, but misconfigurations in these policies can lead to "confused deputy" attacks. By manipulating parameters or exploiting overly permissive trust relationships in services like AppSync and Amplify, attackers can escalate privileges and access cross-account resources. Security researchers and pentesters should audit their IAM trust policies for missing condition keys, specifically
aws:SourceAccountandaws:SourceArn, to prevent unauthorized role assumption.
Cloud security often feels like a game of cat and mouse played within the boundaries of IAM policies. While most of us are hyper-focused on the permissions attached to a role, we frequently overlook the trust policy that governs who—or what—is allowed to assume that role in the first place. Recent research into AWS services like AppSync and Amplify reveals that these trust relationships are a massive, under-explored attack surface. If you are performing a cloud penetration test or hunting for bugs, you need to stop looking only at what a role can do and start looking at who is allowed to trigger it.
The Confused Deputy in AWS AppSync
The "confused deputy" problem is a classic in security, but it remains highly relevant in serverless environments. In the context of AWS, it occurs when a service is tricked into using its elevated permissions to perform an action on behalf of an attacker.
In the case of AWS AppSync, the service requires an IAM role to interact with data sources. By default, this role includes a trust policy that allows the AppSync service to assume it. The vulnerability arises when an attacker can influence the configuration of the AppSync API. During research, it was discovered that the AppSync API was not strictly case-sensitive regarding certain parameters. By manipulating the casing of the serviceRoleArn parameter, an attacker could bypass validation checks intended to prevent cross-account role assumption.
This is not just a theoretical edge case. If an attacker can create or update an AppSync data source, they can point the service to an IAM role in a different, victim account. Because the AppSync service is the one performing the AssumeRole call, it bypasses the standard checks that would normally stop a user from assuming a role they don't own. Once the service assumes the victim's role, the attacker can execute any action permitted by that role, effectively turning the AppSync service into a proxy for their malicious activity.
Weaponizing AWS Amplify and the Role of Condition Keys
AWS Amplify presents a different, yet equally dangerous, scenario. Amplify abstracts away the complexity of setting up backend resources, but this convenience comes at a cost. When you initialize an Amplify project, it automatically creates IAM roles to manage your infrastructure.
The research highlighted that early versions of the Amplify CLI and Amplify Studio generated trust policies that were dangerously permissive. Specifically, these policies lacked the necessary condition keys to restrict which entities could assume the roles. Without these restrictions, any user with access to the identity provider—or in some cases, any user at all—could potentially assume the role.
The fix, and the primary defense against these types of attacks, is the implementation of IAM Policy Condition Keys. Specifically, you must use aws:SourceAccount or aws:SourceArn to ensure that only your specific resources can trigger the role assumption.
For example, a secure trust policy for a role used by a service should look like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": { "Service": "appsync.amazonaws.com" },
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"aws:SourceAccount": "123456789012"
}
}
}
]
}
By adding the aws:SourceAccount condition, you ensure that even if an attacker tries to point the service to your role, the AssumeRole request will be denied because the request is not originating from your account.
Auditing for Vulnerable Roles
For those of us on the offensive side, finding these misconfigurations is a matter of scale. Using tools like Sourcegraph, you can search public GitHub repositories for patterns that indicate vulnerable IAM role definitions. The research demonstrated that searching for specific naming conventions—like roles ending in authRole or unauthRole—often reveals thousands of results.
Many of these roles are associated with Amplify projects that were deployed years ago and never updated. If you are on an engagement, start by enumerating the IAM roles in the environment. Look for trust policies that trust a service principal but lack any Condition block. If you find one, attempt to assume that role from an account you control. If the trust policy is missing the aws:SourceAccount restriction, you have a clear path to initial access.
The impact of these vulnerabilities is significant. CVE-2024-28056 serves as a stark reminder that even managed services can be weaponized if the underlying trust relationships are not properly scoped. As we continue to move toward more complex, interconnected cloud architectures, the "confused deputy" will remain one of our most effective vectors.
Defenders need to treat trust policies with the same rigor as they treat IAM policies. If you are a developer, stop relying on the default configurations provided by CLI tools. If you are a researcher, keep digging into the commit history of open-source infrastructure tools. The next big vulnerability is likely hidden in a default configuration file that someone thought was "good enough" five years ago.
CVEs
Vulnerability Classes
Tools Used
Target Technologies
All Tags
Up Next From This Conference

Breaking Secure Web Gateways for Fun and Profit

Listen to the Whispers: Web Timing Attacks That Actually Work

Abusing Windows Hello Without a Severed Hand
Similar Talks

Kill List: Hacking an Assassination Site on the Dark Web

Firewalls Under Fire: China's Ongoing Campaign to Compromise Network Protection Devices

