|
|
|
|
|
by danjoc
3736 days ago
|
|
>The stance was without an agreed upon way of trusting public keys, you don't get any additional protection beyond shasum. Isn't that true? No, that is not true. It is demonstrably wrong and was demonstrated this week. https://medium.freecodecamp.com/npm-package-hijacking-from-t... shasums do nothing to stop package hijacking. An attacker can regenerate a shasum at will. A GPG signature cannot be forged and it will be very clear if a public key is changed. |
|
If it's from NPM, an attacker who could convince you to download the wrong package could convince you to download the wrong public key, too.
If it's from previous versions of the package, what happens if the author loses the public key, or if package ownership needs to be transferred (another name dispute, or the author abandons their package)? Does NPM force people installing the package to decide whether to accept the new key? If NPM merely warns people installing the package, the situation is again barely better than an NPM-provided shasum.