Skip to content
Leaked secrets Write-up Beginner

Infosys leaked Full Admin Access AWS keys on PyPi for over a year

An internal Infosys package published to PyPI contained hardcoded AWS access and secret keys with AdministratorAccess permissions. An attacker could use these keys to access an S3 bucket that appeared to contain COVID patient data and to perform any action in the AWS account.

tomforb.es

Published on tomforb.es

You can check out their website for a lot of buzwords, but it’s clear from all the stock photos that they take security Very Seriously Indeed ™️.

The author, on tomforb.es

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, developers were issued long-lived AWS IAM user keys with full administrative permissions and stored them in plaintext in source code that was accidentally published.

Impact

The keys could have allowed an attacker to access a bucket that appeared to contain medical data and to perform any action in the AWS account, though the author did not access the clinical files to verify their contents.

What the attacker needed

Public PyPI package; no authentication needed

The fix

The author deleted the access key himself; the underlying issue should be fixed by not storing long-lived admin keys in code and by rotating them.

How it was found

  1. The author noticed a pull request attempting to delete a package called ihip from his pypi-data project.
  2. He downloaded the publicly available release file for that package.
  3. He found an AWS access key and secret key embedded as string constants in the file.
  4. He checked whether the key was still active and found it was.
  5. He listed the root of an S3 bucket accessible with the key and saw what appeared to be clinical data.
  6. He inspected the IAM permissions and found the key had AdministratorAccess.

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.

A company accidentally uploaded a software package to a public repository. Inside that package were secret login details for their cloud account, which gave full control over everything in that account. Anyone who found the package could have used those details to access sensitive data.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.