Re:'No way to prevent this,' says only package manager where...
by yegle on Friday May 15, 2026 @10:03PM
(#48156134)
`go:generate` is for the package provider, the command never runs when someone `go install` or `go get` the package.
Re:'No way to prevent this,' says only package manager where...
by cookiengineer on Friday May 15, 2026 @10:12PM
(#48156180)
Note that the NPM worms are spreading because the package providers are developing on their libraries without them noticing a malicious dependency. It is not users/consumers spreading the worm, it is developers spreading it.
Your mismatch is that you think in policies, not assessments here. Nothing in my normal go workflow will ask me if I want to run "curl download whatever from the internet" when I run go build.
Though I agree with the difference in workflow, there is not a single mechanism in go catching this. go.mod files can be just patched by the worm, and/or hidden behind a /v123 folder or whatever to play shenanigans on API differences.
Re:'No way to prevent this,' says only package manager where...
by xena on Friday May 15, 2026 @10:03PM
(#48156135)
go:generate is done at dev time, not at build time.
Re:'No way to prevent this,' says only package manager where...
by cookiengineer on Friday May 15, 2026 @10:05PM
(#48156145)
Actually bindings are usually generated like that, at build time (though with a build cache that nobody knows how it corrupts all the time).
Examples that come to mind: webview/webview, webkit, cilium/ebpf and most other CGo projects that I have seen.
NPM's achilles is the pre/postinstall step which can run arbitrary commands and shell scripts without the user having any way to intervene.
Dependencies must be run in isolated chroot sandboxes or better, inside containers. That would be the only way to mitigate this problem, as the filesystem of the operating system must be separated from the filesystem of the development workflow.
On top of that most host based firewalls are per-binary instead of per-cmdline. That leads to the warnings and rules relying on that e.g. "python" or "nodejs" getting network access allowlisted, instead of say "nodejs myworm.js". So firewalls in general are pretty useless against this type of malware.