News for hackers. Stuff that matters.
Re:Npm packages with over 1b weekly downloads, incl. Chalk, ... by DDerTyp on Monday September 08, 2025 @10:45AM (#45168982)
The discrepancy comes from how npm packages are published. What you see on GitHub is whatever the maintainer pushed to the repo, but what actually gets published to the npm registry doesn’t have to match the GitHub source. A maintainer (or someone with access) can publish a tarball that includes additional or modified files, even if those changes never appear in the GitHub repo. That’s why the obfuscated code shows up when inspecting the package on npmjs.com.

As for the “0 downloads” count: npm’s stats are not real-time. There’s usually a delay before download numbers update, and in some cases the beta UI shows incomplete data. Our pipeline picked up the malicious version because npm install resolved to it based on semver rules, even before the download stats reflected it. Running the build locally reproduced the same issue, which is how we detected it without necessarily incrementing the public counter immediately.

Re:Npm packages with over 1b weekly downloads, incl. Chalk, ... by Jenk on Monday September 08, 2025 @11:18AM (#45169408)
It can also be that the repo was modified after a release.
Re:Npm packages with over 1b weekly downloads, incl. Chalk, ... by alaintno on Monday September 08, 2025 @10:48AM (#45169024)
I see, thanks for the explanations, and thanks for warning us about this!