Support for PGP / Signatures #464
Replies: 3 comments 5 replies
-
Given that the author has to have to ability to change their public key(s) (in the case of revocation, and/or to have multiples), what would stop an attacker who otherwise has publish access from adding a new public key, and publishing with the new private key? |
Beta Was this translation helpful? Give feedback.
-
The signing of packages has been discussed so many times, that I don't believe there's any arguments that remain that would change anyone's opinions enough for this to get implemented natively in npm in whatever form. That said, I've been pondering some ideas to get this implemented in userland. Someone who has the infrastructure to set up and verify signing keys, would maybe have the infrastructure to maintain whatever is necessary to publish things with signatures? I assume the general public ecosystem will not adopt this, not at the scale required anyways - so it's up to whoever needs this extra security to keep it maintained. As for implementation - at its simplest, I figured that an author could just attach the signatures on the Github Release? I doubt there'd be a place for any of the new metadata anywhere on npm (packument or else). If there was a convention, then maybe there'd be an option to at least discuss some hooks in npm cli, which would allow intercepting packages to verify signatures before extraction? |
Beta Was this translation helpful? Give feedback.
-
The way I would see npm support this is to just add an additional in the packument / package.json, so signatures would exist in a common standard place, and then have a way for userland signature implementation to easily plug in to verify that. That is, discussing public key / private key infrastructure is out of scope. An additional change could be to the registry website to highlight when packages do have signatures published. |
Beta Was this translation helpful? Give feedback.
-
Currently the only means of trusting a package on npm is through the fact that the registry is immutable* and the usage of SRIs / tarball integrity checksums. Are there developments towards supporting package signatures via PGP or signify, or https://gossamer.tools/ for being able to verify that the tarball uploaded is the tarball the author published?
Sure, to attack this way would likely require an inside-actor at npm / github to modify the tarball & integrity checksum, so the attack surface is low, but for high security applications, this could make sense.
(npm ci already fails if the integrity sum is not valid, so as long as you commit a lockfile, you should be safe in majority of cases)
Beta Was this translation helpful? Give feedback.
All reactions