Survey of popular Node.js packages reveals credential leaks
The author found that many popular Node.js packages had leaked credentials (npm passwords/tokens, GitHub tokens/passwords) through files like config.gypi, logs, and dotfiles. An attacker with these credentials could publish malicious versions of packages or push to repositories, potentially compromising many dependent projects.
github.com
Published on github.com
History
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, credentials were leaked because developers included sensitive files (such as .npmrc, config.gypi, logs, or dotfiles) in published packages or public repositories, and npm sometimes exposed credentials to child processes.
Impact
An attacker with leaked credentials could publish malicious versions of popular packages or push code to repositories, potentially affecting many dependent projects; however, npm and GitHub have since implemented automatic revocation of leaked tokens and passwords, and npm fixed the credential leak to child processes.
What the attacker needed
Access to public npm packages or GitHub repos; leaked credentials present in public files
The fix
The issue was fixed by npm no longer leaking credentials to child processes, and by npm and GitHub automatically revoking leaked tokens and resetting passwords when found in public packages or repositories.
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.
This report is about developers accidentally publishing secret passwords or access tokens (like keys) in public code packages. Because these packages are used by many other projects, an attacker who finds the secrets could take over the package and insert harmful code. The author scanned public sources and found many such leaks, showing that even experienced developers make this mistake.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.