Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 2 min read

It only takes 8 seconds to steal passwords from public programs

How long does a leaked API key survive in a public repository? Stony Brook University researchers published 300 test packages containing decoy AWS, OpenAI, and Anthropic keys. Automated scrapers accessed the first AWS

How long does a leaked API key survive in a public repository?

Stony Brook University researchers published 300 test packages containing decoy AWS, OpenAI, and Anthropic keys.

Automated scrapers accessed the first AWS key just 7.8 seconds after upload, with a 100% compromise rate for the first 100 keys within 15 minutes.

The study demonstrates that automated bots are continuously harvesting secrets from public platforms, often long before a manual remediation step can occur.

The study was conducted by Billy Tsouvalas and Nick Nikiforakis of Stony Brook University. Over four months, they published 300 test packages to eight public services. Inside the packages, they included test access keys for AWS, OpenAI, and Anthropic, as well as fake login credentials for remote access to computers and databases.

In the first phase, the researchers published 100 packages to Docker Hub without pushing them. These were downloaded 58.819 times. The AWS keys received 66.321 requests from 3.842 different addresses on the internet. The addresses indicate where the requests were made from, not how many attackers were behind them.

The 7,86 seconds was the fastest case, not the typical time. In the median case, the first request to AWS was made within 51,19 seconds. All 100 keys received requests within 15 minutes of being published.

The researchers found no evidence that anyone opened or ran the packages. They estimate that automated programs likely read their contents directly. Thus, a password or other secret can be detected even if it is removed at a later stage of package creation: it may remain in an earlier part of it.

↳

READ ALSO

HACKS.GR / RELATED

Cyber ​​Attacks & Data Breaches

Extortion group targets NVIDIA with ransom countdown

β†—

Some requests to AWS were checking if the keys were working. Others were trying to see what resources were available or to use paid services. The researchers’ restrictions prevented attempts to consume AWS resources. In contrast, requests with the OpenAI and Anthropic test keys exhausted the researchers’ test balances.

How do they propose to protect the keys?

The researchers recommend that the entire finished package be checked before publication, along with its individual parts and accompanying information β€” not just the folder with the original code. They also suggest that keys be given only at the build step where they are needed and not stored in the settings file that describes how the package is built. For applications using AWS, they recommend temporary keys with limited permissions.

If an AWS key is published in a public package, the researchers recommend that it be deactivated immediately and replaced if it is still needed. Deleting the package does not invalidate copies of the key that may already be held. They also recommend checking AWS activity logs from the time of publication for unknown requests, permission changes, or unexpected resource creation.

The researchers shared their findings with Docker, and the company's security team acknowledged the report. They also suggested checking for secrets before publishing and restricting access to the public feed of new and updated packages.

>Stay connected with Hacks.gr

Set us as a preferred source on Google and find us on social media.

Preferred source

β†—

end of article

Read the original English article on Hacks.gr

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.