Severe Amazon ECR Public Gallery Flaw Could Have Facilitated Massive Supply Chain Attack
by
Nathan Wasson
—
Tuesday, December 13, 2022, 04:30 PM EDT
A researcher at the cloud security company Lightspin recently discovered a flaw in the Amazon Web Services (AWS) Elastic Container Registry (ECR) Public Gallery that threat actors could have exploited to delete or modify container images with billions of downloads. The leveraging of an exploit in this manner would constitute a massive supply chain attack with far reaching effects. Fortunately, it seems that Amazon was able to fix this flaw before any threat actors managed to exploit it.
Amazon’s ECR Public Gallery is home to tens of thousands of publicly available container images, enabling organizations and individual users alike to download and launch containerized software. The top four images in this gallery each have over a billion downloads, and many more of the images have tens to hundreds of millions of downloads. The organizations and users that download popular images from this source rely on the security of the gallery, trusting that the images are stored and served without any meddling from threat actors.
Test container image missing after proof of concept exploit executed (source: Lightspin)
However, the Vice President of Security Research at Lightspin, Gafnit Amiga, discovered a vulnerability in the AWS ECR Public Gallery that threat actors could have exploited to tamper with any of the publicly available images. Within the main JavaScript file of the ECR Public Gallery, Amiga found a set of publicly undocumented API actions for deleting or modifying container images. While undocumented, these API actions were nonetheless active, meaning anyone who discovered them could leverage them for their own purposes, malicious or otherwise.
It took some tinkering and probing, but Amiga managed to create a Python script that invoked one of these undocumented API actions. The researcher then used this script to delete a test image created for this exercise, proving that the vulnerability could be exploited. Lightspin submitted this research and the proof of concept (PoC) to the AWS Security Outreach Team, which promptly notified the ECR Public team of the vulnerability. Together, the two teams fixed the vulnerability in under twenty-four hours.
AWS also searched its logs for any signs of abuse of the undocumented API actions and found nothing other than the researcher’s activity. Assuming this analysis didn’t miss any malicious activity, we can be assured that threat actors didn’t leverage the vulnerability to inject malicious payloads into any container images in the AWS ECR Public Gallery. In a security bulletin released by AWS, the company thanked Lightspin for reporting the vulnerability and said that the flaw is already fixed, requiring no customer action.
Nathan grew up with computer hardware news and reviews in the family business and eventually joined the business himself in 2014. He initially joined to make video reviews and help with the podcast, but was soon asked if he would write, and he's been writing about computers ever since. More recently, Nathan has developed a passion for internet privacy, security, and decentralization and likes writing about those topics the most. He spends much of his free time tinkering with Linux distributions, custom Android ROMs, privacy and security tools, and self-hosting solutions. He also started gaming on a PC at a young age and still can't give up Unreal Tournament 2004 and Supreme Commander 2. Beyond computers, Nathan is a car enthusiast and philosophy nerd.