TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Today’s JavaScript trash fire and pile on

52 pointsby cnorthwoodover 6 years ago

10 comments

olliejover 6 years ago
A pretty good actual summary of the problem.<p>As the article says, I&#x27;m not convinced code signing would have made this not happen - given the distribution model you could trivially just have node library updates check to see whether the owner&#x2F;maintainer had the same user name.<p>Similarly it is absolutely not the fault of the old maintainer - no one should have to commit to permanently supporting a library they wrote years in the past. And if you weren&#x27;t maintaining a library why would you necessarily be opposed to transferring ownership over to someone who is at least apparently working on&#x2F;with it?
评论 #18537152 未加载
crooked-vover 6 years ago
We don&#x27;t need a standard library, they said. Letting basic functionality be spread out through a hundred thousand separate packages is fine, they said...
评论 #18537621 未加载
评论 #18536948 未加载
slowmovintargetover 6 years ago
Aside from validating your dependencies, when you run the code ensure it can&#x27;t phone home.<p>On AWS, lock-down outgoing traffic. The Node instance (heaven help you if it&#x27;s in a browser) on the back-end shouldn&#x27;t be able to get out to anything, with the necessary exceptions of your codes back-end data store, and, perhaps temporarily, your deployment store.
tracker1over 6 years ago
Maybe it could come down to requiring npm modules be accessible on a publicly accessible git repository with enough instructions in the package to build that package&#x27;s output. Exceptions would be the more custom&#x2F;large packages than the rule. Binary packages would of course also need some exceptions.<p>There could be a concept of &quot;trusted&quot; packages. That have had at least a review step. So either your package is trivial and easily automated or difficult with manual review. Where the costs are absorbed is the thing.<p>In the end, I do feel that anything that&#x27;s being published publicly should have publicly available source, and that the build should be repeatable at the least... that wouldn&#x27;t prevent such a thing (if it was checked into git), but would at least make it harder to hide.
2bitencryptionover 6 years ago
One thing I&#x27;m a bit confused about --<p>The attack was present in the minified JS, but not the source JS.<p>(I&#x27;m ignorant about NPM.) Does this mean on NPM, the publisher gets to publish the source AND the minified version? Is there no validation that the minified code is sourced from the true source code?
评论 #18537000 未加载
评论 #18536899 未加载
ummonkover 6 years ago
The trust issue is a fundamental issue with volunteer &#x2F; anonymously-contributed open source.<p>At least with paid software, in theory if not in practice, the organization publishing the software is responsible for verifying it, and for keeping track of whom it is employing to contribute to the code, so you can figure out who to lock up if they intentionally push malicious code.
craftomanover 6 years ago
Another guy blaming a programming language because a third party independent company dont check out every single piece of line for malicious code. Kids these days think injecting 400 dependency libraries is a better idea than writing their own code. P.S Always remember, it&#x27;s your responsibility to check out what code library you adding to your project.
评论 #18537469 未加载
tlackover 6 years ago
Any thoughts on how these situations could be automatically detected by a third party given the current realities of the JS ecosystem? Here are some quick ideas:<p>1. Detect commits that are radically different from previous ones in the same repo by some measure (tricky)<p>2. Detect npm publish events whose contents are different than source repo<p>3. Detect author&#x2F;ownership changes in the context of npm packages<p>What else?
评论 #18537648 未加载
评论 #18539130 未加载
评论 #18537972 未加载
aogailiover 6 years ago
What I don&#x27;t understand, how come there are no automatic red flags&#x2F;or permissions when a deep dependency attempts to write on desk or make network calls?<p>I mean in theory any npm package could have a payload that would hijack the machine or override other system functions, where is the security in any of that?!
iddanover 6 years ago
This is so superficial. How can you talk about ecosystem fragility when NPM is one of the best open source companies and which actually cope with problems (unlike most package registries who are completely passive)
评论 #18536889 未加载