Is there a theoretical framework that can prevent this from happening? Proof-carrying code?
replies(8):
Socket:
- Sep 15 (First post on breach): https://socket.dev/blog/tinycolor-supply-chain-attack-affect...
- Sep 16: https://socket.dev/blog/ongoing-supply-chain-attack-targets-...
StepSecurity – https://www.stepsecurity.io/blog/ctrl-tinycolor-and-40-npm-p...
Aikido - https://www.aikido.dev/blog/s1ngularity-nx-attackers-strike-...
Ox - https://www.ox.security/blog/npm-2-0-hack-40-npm-packages-hi...
Safety - https://www.getsafety.com/blog-posts/shai-hulud-npm-attack
Phoenix - https://phoenix.security/npm-tinycolor-compromise/
Semgrep - https://semgrep.dev/blog/2025/security-advisory-npm-packages...
PATH_ELEMENTS := $(subst :, ,$(PATH))
BIND_COMMANDS := $(foreach element, $(PATH_ELEMENTS), --ro-bind-try $(element) $(element))
define BWRAP_BUILD
bwrap \
--unshare-all \
--unshare-user \
--die-with-parent \
--disable-userns \
--ro-bind /usr/ /usr \
--ro-bind /lib64 /lib64/ \
--ro-bind /lib /lib \
--ro-bind /etc/alternatives/ /etc/alternatives/ \
--ro-bind $(CURDIR) $(CURDIR) \
--proc /proc \
--clearenv \
--setenv PATH $(PATH) \
$(BIND_COMMANDS) \
--setenv GOPATH $(GOPATH) \
--ro-bind $(GOPATH) $(GOPATH) \
--setenv TMPDIR $(XDG_CACHE_HOME)/go-build \
--bind $(XDG_CACHE_HOME)/go-build $(XDG_CACHE_HOME)/go-build \
--setenv XDG_CACHE_HOME $(XDG_CACHE_HOME) \
--dev-bind /dev/null /dev/null \
--setenv PNPM_HOME $(PNPM_HOME) \
--bind-try $(PNPM_HOME) $(PNPM_HOME) \
--setenv HOME $(HOME) \
--bind-try $(CURDIR)/ui/.svelte-kit $(CURDIR)/ui/.svelte-kit \
--bind-try $(CURDIR)/ui/build $(CURDIR)/ui/build \
endef
mybin: $(deps)
$(BWRAP_BUILD) go build -trimpath -ldflags $(ldflags) ./cmd/mybin/
Notes: most of the lines after --setenv GOPATH... are specific to my project and tooling. Some of the lines prior are specifically to accommodate my tooling, but I think that stuff should be reasonably general. Lmk if anyone has any suggestions.