by thenewwazoo · 8y ago · 0 comments
I have come to expect no less from npm, and by extension, nodejs.
This gives the false sense that its safe to install packages again.
It's time to enforce two-factor authentication for publishing packages.
It's time to publish a roadmap towards package signing and verification.
It's time to talk about sandboxing the install scripts to prevent token theft.
We're done for the day is so far from sufficient.
* eslint user FooCorp also gets compromised, and a similarly-malicious version of foolib-js gets published that includes the _same code_ to steal tokens
* npm invalidates all tokens
* you decide to use foolib-js, and your newly-minted token is now compromised
npm are fucking this up, and royally.
> We determined that access tokens for approximately 4,500 accounts could have been obtained before we acted to close this vulnerability. However, we have not found evidence that any tokens were actually obtained or used to access any npmjs.com account during this window.[1]
I get that it's possible that other modules could already be infected, but it's also true that other modules could have been similarly infected long before this one.
[1] https://blog.npmjs.org/post/175824896885/incident-report-npm...
How did they determine tokens for 4,500 accounts could have been obtained, and what is that even supposed to mean? The problem here is that any user of these packages could have had their .npmjs file read and exfiltrated, not just some upstream package maintainer. Were there only 4,500 valid npm tokens or something? I cannot imagine that is the case.
So either they looked at 4,500 packages uploaded during the compromise window and they're not explaining how they undertook to do that, or they don't understand the vector and are minimizing the severity of the issue.
https://gist.github.com/thenewwazoo/0306aa06aafe7807497ed1db...
\u0065val
or e\u0076al
or any other combination of it? eval === this[[1,18,-3,8].map(x=>String.fromCharCode(x+100)).join("")]
https://jsfiddle.net/hkvu9s47/I wonder how many packages in fact got published during that nine-hour time window. Does anyone know what kind of number that would be?
eslint-scope 3.7.2 was published on 2018-07-12T10:40:00.478Z eslint-config-eslint 5.0.2 was published on 2018-07-12T09:49:24.957Z tokens were invalidated at 2018-07-12 12:30 UTC
I'm reading it as tokens created before 2018-07-12 12:30 UTC were invalidated, but the invalidation itself happened on 2018-07-12 18:42 UTC according to eslint's post-mortem[1]. I think the latter is the more relevant date.
[1] https://eslint.org/blog/2018/07/postmortem-for-malicious-pac...
> We determined that access tokens for approximately 4,500 accounts could have been obtained before we acted to close this vulnerability. However, we have not found evidence that any tokens were actually obtained or used to access any npmjs.com account during this window.
Source: https://blog.npmjs.org/post/175824896885/incident-report-npm...
"npm has revoked all access tokens issued before 2018-07-12
12:30 UTC. As a result, all access tokens compromised by
this attack should no longer be usable."