Essential vulnerabilities in 6 AWS providers disclosed at Black Hat USA – Cyber Tech
Essential vulnerabilities in six providers beneath Amazon Internet Providers (AWS) may have enabled account takeover, distant code execution, AI knowledge manipulation, delicate info disclosure and extra, researchers from Aqua Safety disclosed at Black Hat USA on Wednesday.
The discoveries by Aqua Safety’s Nautilus analysis group have been offered within the session “Breaching AWS Accounts By way of Shadow Sources” Wednesday morning on the cybersecurity convention held this yr in Las Vegas. The analysis was offered by Lead Safety Researcher Yakir Kadkoda and Senior Safety Researcher Ofek Itach, of Aqua Safety, and former Aqua Safety Researcher Michael Katchinskiy.
[For up-to-the-minute Black Hat USA coverage by SC Media, Security Weekly and CyberRisk TV visit our spotlight Black Hat USA 2024 coverage page.]
The “Shadow Sources” assault vector, which has since been addressed by AWS, stemmed from the automated era of S3 buckets by numerous AWS providers, together with CloudFormation, Glue, EMR, SageMaker, ServiceCatalog and CodeStar. Customers might not be conscious that these buckets are being created after they begin a brand new challenge or file add, and the bucket names comply with a predictable naming scheme that could possibly be exploited by an attacker.
First found within the CloudFormation service and later recognized within the 5 different providers by means of additional investigation, the Shadow Sources flaw enabled an attacker to create their very own S3 bucket utilizing the predetermined title of a bucket but to be created by the goal. For CloudFormation, auto-generated S3 buckets adopted a naming format that included a service-wide fastened prefix, a novel hash that continues to be constant for a given AWS account, and the area that the bucket was created from.
Due to this fact, if an attacker knew the goal’s distinctive hash, they might create a bucket together with the CloudFormation prefix, the hash and any of the 33 AWS areas. No two S3 buckets can have the identical title throughout any accounts, so when the focused person’s account makes an attempt to create a brand new bucket with the title claimed by the attacker, it is going to lead to an error – or worse.
AWS flaws allowed attackers to ‘squat’ in different customers’ ‘shadow buckets’
The researchers discovered that, within the case of CloudFormation, trying to add a template file from a area the place an attacker has already claimed the anticipated bucket title would trigger the template to be positioned within the attacker’s bucket, however provided that the attacker configured the bucket to permit public entry and skim and write permissions for the CloudFormation service.
By getting access to the sufferer’s uploaded file, not solely may the attacker steal doubtlessly delicate info saved within the template, however they might additionally manipulate the template to inject a backdoor, resulting in potential account takeover. This could possibly be carried out utilizing a Lambda operate that takes benefit of the time between preliminary template add and template execution to mechanically inject a backdoor as quickly because the template is positioned within the attacker’s bucket.
The backdoor described by the researchers is within the type of a brand new admin function that may later be assumed by the attacker. Nonetheless, the researchers notice that such a backdoor can solely be created if the sufferer person who uploaded the template, by way of the AWS Administration Console, has permissions to create new admin roles.
Because of the vulnerability, attackers may primarily squat in “shadow buckets” mechanically created by CloudFormation and doubtlessly unknown to the goal themselves, merely ready for the goal to create a brand new CloudFormation stack in a brand new area for the primary time, triggering the Lambda operate and backdoor injection.
“Whereas this course of can take a while, it’s good to take into account that in large organizations with tons of of accounts and 1000’s of customers the chance of incidence is excessive,” the researchers famous in a weblog put up.
A number of AWS providers beforehand susceptible to ‘Shadow Sources,’ ‘Bucket Monopoly’ assaults
Following their discovery of the “Shadow Sources” vulnerability in AWS CloudFormation, the researchers expanded their investigation to different AWS providers and found that the Glue, EMR, SageMaker, ServiceCatalog and CodeStar providers have been additionally affected by their very own variations of the flaw.
All of those providers created “shadow buckets” to retailer sure assets upon a brand new person motion, corresponding to creating a brand new Glue job, new EMR Studio or new SageMaker Canvas, and these buckets had predictable names together with fastened prefixes, AWS account IDs and area codes.
Relying on the service, exploitation of the vulnerability may lead to completely different impacts: manipulating the code of Glue jobs may result in distant code execution (RCE), injecting code into Jupyter notebooks uploaded by EMR may allow cross-site scripting (XSS) assaults, studying and writing of SageMaker datasets may result in theft or manipulation of AI coaching datasets and squatting of CodeStar S3 buckets can result in denial-of-service (DoS) because of the incapability to create new tasks utilizing one other account’s bucket.
Attackers may enhance the success fee of their assaults by creating what the researchers referred to as a “Bucket Monopoly,” claiming the names of all potential buckets in all areas for any identified person hash or account ID. This fashion, any new bucket generated in any area by the goal would result in an attacker-controlled bucket.
Aqua Safety first reported these flaws to the AWS safety group in February 2024, prompting a swift response that concluded with full decision of all vulnerabilities by June 2024.
AWS account IDs, distinctive hashes ought to be handled as secrets and techniques
Though the “Shadow Sources” vulnerabilities have been addressed by AWS, the researchers notice that their findings display the significance of treating potential identifiers, corresponding to AWS account IDs, as secrets and techniques. The Shadow Sources and Bucket Monopoly attackers depend on the attacker acquiring both the account ID or distinctive CloudFormation bucket hash of the sufferer, that means that defending these values may successfully forestall the assaults.
The researchers have been in a position to uncover many uncovered CloudFormation hashes and AWS account IDs by conducting regex searches on GitHub, and huge lists of identified AWS account IDs are additionally out there on-line, exhibiting the scope of the risk posed by the now-resolved vulnerabilities. S3 bucket squatting should be a priority, nonetheless, as some open-source AWS integrations additionally mechanically generate S3 buckets that will have equally predictable names. With a purpose to forestall exploitation of comparable, not but recognized flaws in open-source integrations and different providers, the researchers advocate customers keep away from exposing their account IDs and hashes, implement the aws:ResourceAccount situation to make sure providers keep away from utilizing buckets owned by different accounts, confirm the possession of buckets utilized by their providers and use distinctive names for S3 buckets at any time when potential, somewhat than predictable names following identified naming conventions.
Additionally, because the potential for account takeover utilizing this vulnerability was depending on the permission degree of the person whose motion triggered use of the attacker’s S3 bucket, this demonstrates the significance of following least privilege ideas when assigning roles to customers.