| ▲ | codemonkey-zeta 4 hours ago |
| I'm coming to the unfortunate realizattion that supply chain attacks like this are simply baked into the modern JavaScript ecosystem. Vendoring can mitigate your immediate exposure, but does not solve this problem. These attacks may just be the final push I needed to take server rendering (without js) more seriously. The HTMX folks convinced me that I can get REALLY far without any JavaScript, and my apps will probably be faster and less janky anyway. |
|
| ▲ | jeswin 2 hours ago | parent | next [-] |
| Traditional JS is actually among the safest environments ever created. Every day, billions of devices run untrusted JS code, and no other platform has seen sandboxed execution at such scale. And in nearly three decades, there have been very few incidents of large successful attacks on browser engines. That makes the JS engine derived from browsers the perfect tool to build a server side framework out of. However, processes and practices around NodeJS and npm are in dire need of a security overhaul. leftpad is a cultural problem that needs to be addressed. To start with, snippets don't need to be on npm. |
| |
| ▲ | spankalee 2 hours ago | parent | next [-] | | Sandboxing doesn't do any good if the malicious code and target data are in the same sandbox, which is the whole point of these supply-chain attacks. | | |
| ▲ | pixl97 an hour ago | parent [-] | | I mean, what does do good if your supply chain is attacked? This said, less potential vendors supplying packages 'may' reduce exposure, but doesn't remove it. Either way, not running the bleeding edge packages unless it's a known security fix seems like a good idea. |
| |
| ▲ | skydhash 2 hours ago | parent | prev | next [-] | | I think the smallest C library I’ve seen was a single file to include on your project if you want terminal control like curses on windows. A lot of libraries on npm (and cargo) should be gist or a blog post. | |
| ▲ | WD-42 2 hours ago | parent | prev | next [-] | | Javascript doesn't have a standard library, until it does the 170 million[1] weekly downloads of packages like UUID will continue. You can't expect people to re-write everything over and over. [1]https://www.npmjs.com/package/uuid | | |
| ▲ | simiones an hour ago | parent | next [-] | | That's not the problem. There is a cultural (and partly technical) aversion in JavaScript to large libraries - this is where the issue comes from. So, instead of having something like org.apache.commons in Java or Boost in C++ or Posix in C, larger libraries that curate a bunch of utilities missing from the standard library, you get an uncountable number of small standalone libraries. I would bet that you'll find a third party `leftpad` implementation in org.apache.commons or in Spring or in some other collection of utils in Java. The difference isn't the need for 3rd party software to fix gaps in the standard library - it's the preference for hundreds of small dependencies instead of one or two larger ones. | |
| ▲ | jmull an hour ago | parent | prev | next [-] | | FYI, there's crypto.randomUUID() That's built in to server side and browser. | |
| ▲ | skydhash 2 hours ago | parent | prev | next [-] | | You have the DOM and Node APIs. Which I think cover more than C library or Common Lisp library. Adding direct dependencies is done by every project. The issue is the sprawling deps tree of NPM and JS culture. > You can't expect people to re-write everything over and over. That’s the excuse everyone is giving, then you see thousands of terminal libraries and calendar pickers. | | |
| ▲ | chamomeal an hour ago | parent [-] | | When I was learning JS/node/npm as a total programming newbie, a lot of the advice online was basically “if you write your own version of foobar when foobar is already available as an npm package, you’re stupid for wasting your time”. I’d never worked in any other ecosystem, and I wish I realized that advice was specific to JS culture |
| |
| ▲ | an hour ago | parent | prev [-] | | [deleted] |
| |
| ▲ | kortilla 2 hours ago | parent | prev | next [-] | | None of those security guarantees matter when you take out the sandbox, which is exactly what server-side JS does. The isolated context is gone and a single instance of code talking to an individual client has access to your entire database. It’s a completely different threat model. | | |
| ▲ | galaxyLogic an hour ago | parent [-] | | So maybe the solution would be to sandbox Node.js? I'm not quite sure what that would mean, but if it solves the problem for browsers, why not for server? | | |
| ▲ | simiones an hour ago | parent | next [-] | | You can't sandbox the code that is supposed to talk to your DB from your DB. And even on client side, the sandboxing helps isolate any malicious webpage, even ones that are accidentally malicious, from other webpages and from the rest of your machine. If malicious actors could get gmail.com to run their malicious JS on the client side through this type of supply-chain attack, they could very very easily steal all of your emails. The browser sandbox doesn't offer any protection from 1st party javascript. | |
| ▲ | int_19h 42 minutes ago | parent | prev [-] | | Deno does exactly that. But in practice, to do useful things server-side you generally need quite a few permissions. |
|
| |
| ▲ | mewpmewp2 2 hours ago | parent | prev [-] | | Interestingly AI should be able to help a lot with desire to load those snippets. What I'm wondering if it would help the ecosystem, if you were able to rather load raw snippets into your codebase, and source control as opposed to having them as dependencies. So e.g. shadcn component pasting approach. For things like leftPad, cli colors and others you would just load raw typescript code from a source, and there you would immediately notice something malicious or during code reviews. You would leave actual npm packages to only actual frameworks / larger packages where this doesn't make sense and expect higher scrutiny, multi approvals of releases there. |
|
|
| ▲ | lucideer 3 hours ago | parent | prev | next [-] |
| > I'm coming to the unfortunate realizattion that supply chain attacks like this are simply baked into the modern JavaScript ecosystem. I see this odd take a lot - the automatic narrowing of the scope of an attack to the single ecosystem it occurred in most recently, without any real technical argument for doing so. What's especially concerning is I see this take in the security industry: mitigations put in place to target e.g. NPM, but are then completely absent for PyPi or Crates. It's bizarre not only because it leaves those ecosystems wide open, but also because the mitigation measures would be very similar (so it would be a minimal amount of additional effort for a large benefit). |
| |
| ▲ | kees99 3 hours ago | parent | next [-] | | I agree other repos deserve a good look for potential mitigations as well (PyPI too, has a history of publishing malicious packages). But don't brush off "special status" of NPM here. It is unique in that JS being language of both front-end and back-end, it is much easier for the crooks to sneak in malware that will end up running in visitor's browser and affect them directly. And that makes it a uniquely more attractive target. | | |
| ▲ | znort_ 2 hours ago | parent [-] | | npm in itself isn't special at all, maybe the userbase is but that's irrelevant because the mitigation is pretty easy and 99.9999% effective, works for every package manager and boils down to: 1- thoroughly and fully analyze any dependency tree you plan to include
2- immediately freeze all its versions
3- never update without very good reason or without repeating 1 and 2 in other words: simply be professional, face logical consequences if you aren't. if you think one package manager is "safer" than others because magic reasons odds are you'll find out the hard way sooner or later. | | |
| ▲ | tbrownaw 2 hours ago | parent | next [-] | | Your item #1 there may be simple, but that's not the same as being easy. | |
| ▲ | moi2388 an hour ago | parent | prev [-] | | Good luck with nr 1 in the js ecosystem and its 30k dependencies 50 branches deep per package |
|
| |
| ▲ | woodruffw 3 hours ago | parent | prev | next [-] | | Could you say more about what mitigations you’re thinking of? I ask because think the directionality is backwards here: I’ve been involved in packaging ecosystem security for the last few years, and I’m generally of the opinion that PyPI has been ahead of the curve on implementing mitigations. Specifically, I think widespread trusted publishing adoption would have made this attack less effective since there would be fewer credentials to steal, but npm only implemented trusted publishing recently[1]. Crates also implemented exactly this kind of self-scoping, self-expiring credential exchange ahead of npm. (This isn’t to malign any ecosystem; I think people are also overcorrect in treating this like a uniquely JavaScript-shaped problem.) [1]: https://github.blog/changelog/2025-07-31-npm-trusted-publish... | |
| ▲ | simiones 37 minutes ago | parent | prev | next [-] | | Most people have addressed the package registry side of NPM. But NPM has a much, much bigger problem on the client side, that makes many of these mitigations almost moot. And that is that `npm install` will upgrade every single package you depend on to its latest version that matches your declared dependency, and in JS land almost everyone uses lax dependency declarations. So, an attacker who simply publishes a new patch version of a package they have gained access to will likely poison a good chunk of all of the users of that package in a relatively short amount of time. Even if the projects using this are careful and use `npm ci` instead of `npm install` for their CI builds, it will still easily get developers to download and run the malicious new version. Most other ecosystems don't have this unsafe-by-default behavior, so deploying a new malicious version of a previously safe package is not such a major risk as it is in NPM. | | |
| ▲ | lucideer 22 minutes ago | parent | next [-] | | > in JS land almost everyone uses lax dependency declarations They do, BUT. Dependency versioning schemes are much more strictly adhered to within JS land than in other ecosystems. PyPi is a mishmash of PEP 440, SemVer, some packages incorrectly using one in the format of the other, & none of the 3 necessarily adhering to the standard they've chosen. Other ecosystems are even worse. Also - some ecosystems (PyPi again) are committing far worse offences than lax versioning - versionless dependency declaration. Heavy reliance on requirements.txt without lockfiles where half the time version isn't even specified at all. Astral/Poetry are improving the situation here but things are still bad. Maven land is full of plugins with automated pom.xml version templating that has effectively the same effect as lax versioning, but without any strict adherence to any kind of standard like semver. Yes, the situation in JS land isn't great, but there are much worse offenders out there. | |
| ▲ | Tadpole9181 17 minutes ago | parent | prev [-] | | `npm install` uses a lockfile by default and will not change versions. No, not transitives either. You would have to either manually change `package.json` or call `npm update`. You'd have to go out of your way to make your project as bad as you're describing. | | |
| ▲ | lucideer 10 minutes ago | parent [-] | | A lot of people use tools like Dependabot which automates updates to the lockfile. |
|
| |
| ▲ | weinzierl 3 hours ago | parent | prev | next [-] | | Which mitigations specifically are in npm but not in crates.io? As far as I know crates.io has everything that npm has, plus - strictly immutable versions[1] - fully automated and no human in the loop perpetual yanking - no deletions ever - a public and append only index Go modules go even further and add automatic checksum verification per default and a cryptographic transparency log. Contrast this with docker hub for example, where not even npm's basic properties hold. So, it is more like docker hub ⊂ npm ⊂ crates.io ⊂ Go modules [1] Nowadays npm has this arguably too | | |
| ▲ | lucideer 34 minutes ago | parent [-] | | To clarify (a lot of sibling commenters misinterpreted this too so probably my fault - can't edit my comment now): I'm not referring to mitigations in public repositories (which you're right, are varied, but that's a separate topic). I'm purely referring to internal mitigations in companies leveraging open-source dependencies in their software products. These come in many forms, everything from developer education initiatives to hiring commercial SCA vendors, & many other things in between like custom CI automations. Ultimately, while many of these measures are done broadly for all ecosystems when targeting general dependency vulnerabilities (CVEs from accidental bugs), all of the supply-chain-attack motivated initiatives I've seen companies engage in are single-ecosystem. Which seems wasteful. |
| |
| ▲ | WD-42 2 hours ago | parent | prev [-] | | I mostly agree. But NPM is special, in that the exposure is so much higher. The hypothetical python+htmx web app might have 10s of dependencies (including transitive) whereas your typical Javascript/React will have 1000s. All an attacker needs to do is find one of many packages like TinyColor or Leftpad or whatever and now loads of projects are compromised. | | |
| ▲ | lucideer 28 minutes ago | parent | next [-] | | > NPM is special, in that the exposure is so much higher. NPM is special in the same way as Windows is special when it comes to malware: it's a more lucrative target. However, the issue here is that - unlike Windows - targetting NPM alone does not incur significantly less overhead than targetting software registries more broadly. The trade-off between focusing purely on NPM & covering a lot of popular languages isn't high, & imo isn't a worthwhile trade-off. | |
| ▲ | skydhash 2 hours ago | parent | prev | next [-] | | Stuff like Babel, React, Svelte, Axios, Redux, Jest… should be self contained and not depend on anything other than being a peer dependency. They are core technological choices that happens early in the project and is hard or impossible to replace afterwards. | | |
| ▲ | WorldMaker 15 minutes ago | parent [-] | | - I feel that you are unlikely to need Babel in 2025, most things it historically transpiled are Baseline Widely Available now (and most of the things it polyfilled weren't actually Babel's but brought in from other dependencies like core-js, which you probably don't need either in 2025). For the rest of the things it still transpiles (pretty much just JSX) there are cheaper/faster transpilers with fewer external dependencies and runtime dependencies (Typescript, esbuild). It should not be hard to replace Babel in your stack: if you've got a complex webpack solution (say from CRA reasons) consider esbuild or similar. - Axios and Jest have "native" options now (fetch and node --test). fetch is especially nice because it is the same API in the browser and in Node (and Deno and Bun). - Redux is self-contained. - React itself is sort of self-contained, it's the massive ecosystem that makes React the most appealing that starts to drive dependency bloat. I can't speak to Svelte. |
| |
| ▲ | johnisgood 2 hours ago | parent | prev [-] | | Well, your typical Rust project has over 1000 dependencies, too. Zed has over 2000 in release mode. | | |
| ▲ | spoiler 26 minutes ago | parent [-] | | Not saying this in defence of Rust or Cargo, but often times those dependencies are just different versions of the same thing. In a project at one of my previous companies, a colleague noticed we had LOADS of `regex` crate versions. Forgot the number but it was well over 100 | | |
| ▲ | treyd 5 minutes ago | parent [-] | | That seems like a failure in workspace management. The most duplicates I've seen was 3, with crates like url or uuid, even in projects with 1000+ distinct deps. |
|
|
|
|
|
| ▲ | reactordev 3 hours ago | parent | prev | next [-] |
| Until you go get malware Supply chain attacks happen at every layer where there is package management or a vector onto the machine or into the code. What NPM should do if they really give a shit is start requiring 2FA to publish. Require a scan prior to publish. Sign the package with hard keys and signature. Verify all packages installed match signatures. Semver matching isn’t enough. CRC checks aren’t enough. This has to be baked into packages and package management. |
| |
| ▲ | lycopodiopsida 3 hours ago | parent | next [-] | | > Until you go get malware While technically true, I have yet to see Go projects importing thousands of dependencies. They may certainly exist, but are absolutely not the rule. JS projects, however... We have to realize, that while supply chain attacks can happen everywhere, the best mitigations are development culture and solid standard library - looking at you, cargo. I am a JS developer by trade and I think that this ecosystem is doomed. I absolutely avoid even installing node on my private machine. | | |
| ▲ | homebrewer 3 hours ago | parent [-] | | Here's an example off the top of my mind: https://github.com/go-gitea/gitea/blob/main/go.sum | | |
| ▲ | EdiX 2 hours ago | parent | next [-] | | I think you are reading that wrong, go.sum isn't a list of dependencies it's a list of checksums for modules that were, at some point, used by this module. All those different versions of the same module listed there, they aren't all dependencies, at most one of them is. Assuming 'go mod tidy' is periodically run go.mod should contain all dependencies (which in this case seems to be shy of 300, still a lot). | |
| ▲ | mayama 3 hours ago | parent | prev [-] | | Half of go.sum dependencies generally are multiple versions of same package. 400 still a lot, but a huge project like gitea might need them I guess. > cat go.sum |awk '{print $1}' | sort |uniq |wc -l 431 > wc -l go.sum 1156 go.sum |
|
| |
| ▲ | rs999gti 44 minutes ago | parent | prev | next [-] | | > What NPM should do if they really give a shit is start requiring 2FA to publish. How does 2FA prevent malware? Anyone can get a phone number to receive a text or add an authenticator to their phone. I would argue a subscrption model for 1 EUR/month would be better. The money received could pay for certification of packages and the credit card on file can leverage the security of the payments system. | |
| ▲ | psychoslave 3 hours ago | parent | prev | next [-] | | How will multi-factor-authentication prevent such a supply chain issue? That is, if some attacker create some dummy trivial but convenient package and 2 years latter half the package hub depends on it somehow, the attacker will just use its legit credential to pown everyone and its dog. This is not even about stilling credentials. It’s a cultural issue with bare blind trust to use blank check without even any expiry date. https://en.wikipedia.org/wiki/Trust,_but_verify | | |
| ▲ | deanc 2 hours ago | parent [-] | | That's an entirely different issue compared to what we're seeing here. If an attacker rug-pulls of course there is nothing that can be done about that other than security scanning. Arguably some kind of package security scanning is a core-service that a lot of organisations would not think twice about paying npm for. | | |
| ▲ | cesarb an hour ago | parent [-] | | > If an attacker rug-pulls of course there is nothing that can be done about that other than security scanning. As another subthread mentioned (https://news.ycombinator.com/item?id=45261303), there is something which can be done: auditing of new packages or versions, by a third party, before they're used. Even doing a simple diff between the previous version and the current version before running anything within the package would already help. |
|
| |
| ▲ | HillRat 2 hours ago | parent | prev | next [-] | | Sign the package with hard keys and signature. That's really the core issue. Developer-signed packages (npm's current attack model is "Eve doing a man-in-the-middle attack between npm and you," which is not exactly the most common threat here) and a transparent key registry should be minimal kit for any package manager, even though all, or at least practically all, the ecosystems are bereft of that. Hardening API surfaces with additional MFA isn't enough; you have to divorce "API authentication" from "cryptographic authentication" so that compromising one doesn't affect the other. | |
| ▲ | cxr 3 hours ago | parent | prev | next [-] | | If NPM really cared, they'd stop recommending people use their poorly designed version control system that relies on late-fetching third-party components required by the build step, and they'd advise people to pick a reliable and robust VCS like Git for tracking/storing/retrieving source code objects and stick to that. This will never happen. NPM has also been sending out nag emails for the last 2+ years about 2FA. If anything, that constituted an assist in the attack on the Junon account that we saw a couple weeks ago. | | |
| ▲ | ptx 2 hours ago | parent [-] | | NPM lock files seem to include hashes for integrity checking, so as long as you check the lock file into the VCS, what's the difference? | | |
| ▲ | cxr 2 hours ago | parent [-] | | Wrong question; NPM isn't bedrock. The question to be answered if there is no difference is, "In that case, why bother with NPM?" |
|
| |
| ▲ | floydnoel 3 hours ago | parent | prev [-] | | NPM does require 2FA to publish. I would love a workaround! Isn't it funny that even here on HN, misinformation is constantly being spread? | | |
|
|
| ▲ | hoppp 3 hours ago | parent | prev | next [-] |
| They are. Any language that depends heavily on package managers and lacks a standard lib is vulnerable to this. At some point people need to realize and go back to writing vanilla js, which will be very hard. The rust ecosystem is also the same. Too much dependence on packages. An example of doing it right is golang. |
| |
| ▲ | simiones 10 minutes ago | parent | next [-] | | The solution is not to go back to vanilla JS, it's for people to form a foundation and build a more complete utilities library for JS that doesn't have 1000 different dependencies, and can be trusted. Something like Boost for C++, or Apache Commons for Java. | |
| ▲ | pixl97 an hour ago | parent | prev | next [-] | | >and go back to writing vanilla js Lists of things that won't happen. Companies are filled with node_modules importers these days. Even worse, now you have to check for security flaws in that JS that's been written by node_modules importers. That or there could someone could write a standard library for JS? | |
| ▲ | rs186 3 hours ago | parent | prev | next [-] | | Python and Rust both have decent std lib, but it is just a matter of time before this happens in thoae ecosystems. There is nothing unique about this specific attack that could only happen in JavaScript. | |
| ▲ | BrouteMinou 2 hours ago | parent | prev [-] | | C#, Java, and so on. |
|
|
| ▲ | tarruda 4 hours ago | parent | prev | next [-] |
| AFAICT, the only thing this attack relies on, is the lack of scrutiny by developers when adding new dependencies. Unless this lack of scrutiny is exclusive to JavaScript ecosystem, then this attack could just as well have happened in Rust or Golang. |
| |
| ▲ | coldpie 3 hours ago | parent | next [-] | | I don't know Go, but Rust absolutely has the same problem, yes. So does Python. NPM is being discussed here, because it is the topic of the article, but the issue is the ease with which you can pull in unvetted dependencies. Languages without package managers have a lot more friction to pull in dependencies. You usually rely on the operating system and its package-manager-humans to provide your dependencies; or on primitive OSes like Windows or macOS, you package the dependencies with your application, which involves integrating them into your build and distribution systems. Both of those involve a lot of manual, human effort, which reduces the total number of dependencies (attack points), and makes supply-chain issues like this more likely to be noticed. The language package managers make it trivial to pull in dozens or hundreds of dependencies, straight from some random source code repository. Your dependencies can add their own dependencies, without you ever knowing. When you have dozens or hundreds of unvetted dependencies, it becomes trivial for an attacker to inject code they control into just one of those dependencies, and then it's game over for every project that includes that one dependency anywhere in their chain. It's not impossible to do that in the OS-provided or self-managed dependency scenario, but it's much more difficult and will have a much narrower impact. | | |
| ▲ | skydhash 2 hours ago | parent [-] | | If you try installing npm itself on debian, you would think you are downloading some desktop environment. So many little packages. |
| |
| ▲ | 3 hours ago | parent | prev | next [-] | | [deleted] | |
| ▲ | tomjen3 an hour ago | parent | prev | next [-] | | That, and the ability to push an update without human interaction. | |
| ▲ | hsbauauvhabzb 4 hours ago | parent | prev [-] | | JavaScript does have some pretty insane dependency trees. Most other languages don’t have anywhere near that level of nestedness. | | |
| ▲ | staminade 3 hours ago | parent | next [-] | | Don't they? I just went to crates.io and picked a random newly updated crate, which happened to be pixelfix, which fixes transparent pixels in pngs. It has six dependencies and hundreds of transient dependencies, may of which appear to be small and highly specific a la left-pad. https://crates.io/crates/pixelfix/0.1.1/dependencies Maybe this package isn't representative, but it feels pretty identical to the JS ecosystem. | | |
| ▲ | koakuma-chan 3 hours ago | parent [-] | | It depends on `image` which in turn depends on a number of crates to handle different file types. If you disable all `image` features, it only has like 5 dependencies left. | | |
| ▲ | staminade 3 hours ago | parent [-] | | And all those 5 remaining dependencies have lots of dependencies of their own. What's your point? | | |
| ▲ | koakuma-chan 3 hours ago | parent [-] | | > What's your point? Just defending Rust. > 5 remaining dependencies have lots of dependencies of their own. Mostly well-known crates like rayon, crossbeam, tracing, etc. | | |
| ▲ | johnisgood 2 hours ago | parent [-] | | You cannot defend Rust if this is reality. Any Rust project I have ever compiled pulled in over 1000 dependencies. Recently it was Zed with its >2000 dependencies. | | |
|
|
|
| |
| ▲ | cxr 3 hours ago | parent | prev | next [-] | | It's not possible for a language to have an insane dependency tree. That's an attribute of a codebase. | | |
| ▲ | orbital-decay an hour ago | parent | next [-] | | Modern programming languages don't exist in a vacuum, they are tied to the existing codebase and libraries. | |
| ▲ | WD-42 2 hours ago | parent | prev [-] | | Maybe the language should have a standard library then. | | |
| ▲ | skydhash 2 hours ago | parent [-] | | C library is smaller than Node.js (you won’t have HTTP). What C have is much more respectable libraries. If you add libcurl or freetype to your project, it won’t pull the whole jungle with them. | | |
| ▲ | int_19h 36 minutes ago | parent [-] | | What C doesn't have is an agreed-upon standard package manager. Which means that any dependency - including transitive ones! - requires some effort on behalf of the developer to add to the build. And that, in turn, puts pressure on library authors to avoid dependencies other than a few well-established libraries (like libpng or GLib), |
|
|
| |
| ▲ | rixed 3 hours ago | parent | prev | next [-] | | This makes little sense. Any popular language with a lax package management culture will have the exact same issue, this has nothing to do with JS itself.
I'm actually doing JS quasi exclusively these days, but with a completely different tool chain, and feel totally unconcerned by any of these bi-weekly NPM scandals. | |
| ▲ | BrouteMinou 2 hours ago | parent | prev [-] | | Rust is working on that. It's not far behind right now, leave it a couple of years. |
|
|
|
| ▲ | everdrive 3 hours ago | parent | prev | next [-] |
| Javascript is badly over-used and over-depended on. So many websites just display text and images, but have extremely heavy javascript libraries because that's what people know and that is part of the default, and because it enables all the tracking that powers the modern web. There's no benefit to the user, and we'd be better off without these sites existing if there were really no other choice but to use javascript. |
| |
| ▲ | mrweasel 2 hours ago | parent | next [-] | | NPM does seem vastly over represented in these type of compromises, but I don't necessarily think that e.g. pypi is much better in terms of security. So you could very well be correct that NPM is just a nicer, perhaps bigger, target. If you can sneak malware into a JavaScript application that runs in millions of browsers, that's a lot more useful that getting a some number servers running a module as part of a script, who's environment is a bit unknown. Javascript really could do with a standard library. | |
| ▲ | spoiler 23 minutes ago | parent | prev [-] | | > So many websites just display text and images Eh... This over-generalises a bit. That can be said of anything really, including native desktop applications. |
|
|
| ▲ | jddj 4 hours ago | parent | prev | next [-] |
| Is the difference between the number of dev dependencies for eg. VueJs (a JavaScript library for marshalling Json Ajax responses into UI) and Htmx (a JavaScript library for marshalling html Ajax responses into UI) meaningful? There is a difference, but it's not an order of magnitude and neither is a true island. Granted, deciding not to use JS on the server is reasonable in the context of this article, but for the client htmx is as much a js lib with (dev) dependencies as any other. https://github.com/bigskysoftware/htmx/blob/master/package.j... https://github.com/vuejs/core/blob/main/package.json |
|
| ▲ | jmull an hour ago | parent | prev | next [-] |
| Simply avoiding Javascript won't cut it. While npm is a huge and easy target, the general problem exists for all package repositories. Hopefully a supply chain attack mitigation strategy can be better than hoping attackers target package repositories you aren't using. While there's a culture prevalent in Javascript development to ignore the costs of piling abstractions on top of abstractions, you don't have to buy into it. Probably the easiest thing to do is count transitive dependencies. |
|
| ▲ | qudat an hour ago | parent | prev | next [-] |
| The blast radius is made far worse by npm having the concept of "postinstall" which allows any package the ability to run a command on the host system after it was installed. This works for deps of deps as well, so anything in your node_modules has access to this hook. It's a terrible idea and something that ought to be removed or replaced by something much safer. |
| |
| ▲ | zarzavat an hour ago | parent [-] | | I agree in principle, but child_process is a thing so I don't think it makes much difference. You are pwned either way if the package can ever execute code. |
|
|
| ▲ | petcat 4 hours ago | parent | prev | next [-] |
| Rendering template partials server-side and fetching/loading content updates with HTMX in the browser seems like the best of all worlds at this point. |
| |
|
| ▲ | rs999gti an hour ago | parent | prev | next [-] |
| > supply chain attacks You all really need to stop using this term when it comes to OSS. Supply chain implies a relationship, none of these companies or developers have a relationship with the creators other than including their packages. Call it something like "free code attacks" or "hobbyist code attacks." |
| |
| ▲ | shermantanktop an hour ago | parent | next [-] | | “code I picked up off the side of the road” “code I somehow took a dependency on when copying bits of someone’s package.json file” “code which showed up in my lock file and I still don’t know how it got there” | | | |
| ▲ | pixl97 an hour ago | parent | prev | next [-] | | A supply chain can have hobbyists, there's no particular definition that says everyone involved must be a professional registered business. | |
| ▲ | __alexs an hour ago | parent | prev [-] | | I know CrowdStrike have a pretty bad reputation but calling them hobbyists is a bit rude. |
|
|
| ▲ | Aeolun 3 hours ago | parent | prev | next [-] |
| Why is this inevitable? If you use only easily verifyable packages you’ve lost nothing. The whole concept of npm automatically executing postinstall scripts was fixed when my pnpm started asking me every time a new package wanted to do that. |
|
| ▲ | philipwhiuk 4 hours ago | parent | prev | next [-] |
| HTMX is full of JavaScript. Server-side-rendering without JavaScript is just back to the stuff Perl and PHP give you. |
| |
| ▲ | bdcravens 3 hours ago | parent | next [-] | | I don't think the point is to avoid Javascript, but to avoid depending on a random number of third-parties. > Server-side-rendering without JavaScript is just back to the stuff Perl and PHP give you. As well as Ruby, Python, Go, etc. | |
| ▲ | norman784 2 hours ago | parent | prev | next [-] | | HTMX does not have external dependencies, only dev dependencies, reducing the attack surface. | |
| ▲ | hosh 3 hours ago | parent | prev [-] | | Do you count LiveView (Elixir) in that assessment? |
|
|
| ▲ | brazukadev 3 hours ago | parent | prev [-] |
| Not for the frontend. esm modules work great nowadays with import maps. |