I'm running code from the internet!


LavaMoat

@naugtur, 2025

Who's that guy?

npm logo gobble


What if not all packages are _great_ ?
## Story time

Let's install some dependencies!

Ok, catch this: 📦

I'm not runing that.

That's what you think.

npm docs for lifecycle scripts

            "postinstall": "echo 💩 > /etc/hosts"
        
### Ok, wait ``` ✨🐋 npm ci cp node_modules s3:// 🔥🔥🐋🔥🔥 ```

Hold my 🍺


├─app.ts
├─node_modules
│ ├─@naugtur
│ │ └─evilpackage
| │   ├─evilPlots.js --,
| │   └─package.json   |
│ └─typescript         💩
│   ├─lib              |
│   | └─tsc.js <-------'
│   └─package.json
└─package.json
        
## ignore scripts ``` npm ci --ignore-scripts ``` Run selected scritps ``` npm rebuild bcrypt ```
# Oh 💩
#### look what I found! ![lavamoat](./lavamoat-logo.png)

And in that moment
the installation process was protected



You can do that too in 5 minutes or less
#### let's get serious > Dear ${ eslintPluginMaintainer }, > I understand you're busy and I'd be happy to help with maintenance of your tiny but popular plugin... (Or find a common hallucination to slopsquat)
#### ok, just in case you do ![](./ilus/obfuscated.png)
#### yo, there's an app for that! ![lavamoat](./lavamoat-logo.png)
# how ?! ![](./ilus/hacker3.png)
### what's inside? ![lavamoat](./lavamoat-underthe.png)

I'll help you set up LavaMoat in your project

@naugtur   naugtur.pl

naugtur.pl/training