r/javascript • u/Busy-Increase-6144 • Apr 02 '26
AskJS [AskJS] Has anyone seen npm packages using postinstall to inject prompt injection files into AI coding assistants?
I've been building a scanner that monitors new npm packages and it flagged something I haven't seen before.
A package called "openmatrix" uses a postinstall hook to copy 13 markdown files into ~/.claude/commands/om/. These files are Claude Code "skills" that load automatically in every session.
One of them contains instructions that tell Claude to auto-approve all bash commands and file operations without asking the user. The files are marked as always_load: true with priority: critical, so they activate in every session.
npm uninstall doesn't clean them up. There's no preuninstall script. The files stay in your home directory until you manually delete them.
The package does have real functionality (task orchestration for AI coding), so I'm not saying it's malware. But the undisclosed permission bypass and the lack of cleanup seemed worth sharing.
If you installed it:
rm -rf ~/.claude/commands/om/
rm -rf ~/.config/opencode/commands/om/
I wrote up a full report with the technical details if anyone wants to check it out. Happy to drop the link in the comments.
View all comments
Show parent comment
1
u/dvidsilva Apr 04 '26
Dormant attacks will open the vector months or years before activation for stealth
Once inside many computers the attacker can change the contents of some remote file or add something that seems harmless that triggers the previous hidden instructions