by Dotnaught on 6/27/23, 8:50 PM with 11 comments
by TechBro8615 on 6/27/23, 9:57 PM
by tanepiper on 6/27/23, 9:03 PM
It was reported to npm at the time, but they chose to ignore it - https://github.com/npm/npm/issues/17724
by feross on 6/27/23, 9:20 PM
The issue is caused by a disparity between a package's manifest and its tarball contents, which npm does not enforce are consistent. And unfortunately, a lot of data – such as the dependencies, install scripts, license, etc. – is duplicated between the package.json in the tarball and the metadata served by registry.npmjs.org. And every tool uses a different source of truth.
Socket (disclosure: my startup), I'm proud to say, has been using the correct manifest file - the package.json inside the tarball - for all security analysis, which aligns with the installation behavior of every major package manager. This means any attempt to exploit this technique would not have evaded Socket’s analysis. We wrote more about manifest confusion here: https://socket.dev/blog/manifest-confusion