HomeVideos

It just keeps getting worse

Now Playing

It just keeps getting worse

Transcript

509 segments

0:00

All right, everybody. I feel more

0:02

vindicated than ever. I feel like I

0:05

actually have the right answers here. I

0:07

feel like I can see around corners. I

0:10

was right. My hate of the JavaScript

0:14

ecosystem was not unfounded. Yet again,

0:17

we are having more and more security

0:20

issues. Now, this one just happens to

0:22

come with a new flavor. Today, it is yet

0:24

another worm. If you're not familiar

0:27

with how the worm works, effectively,

0:29

someone gets compromised somehow and

0:32

then packages get overridden and

0:35

released in which when you install it,

0:37

it executes a build script in which then

0:39

goes and installs on your system a bunch

0:42

of bad stuff, attempts to steal stuff,

0:44

or maybe it doesn't do anything and

0:45

waits until it's back on CICD. And then

0:48

when you go and publish, it goes and

0:49

takes your stuff and then keeps on doing

0:51

this like forward progressing, always

0:54

publishing new versions of all the

0:55

packages, constantly spreading

0:57

throughout the universe. Now, this

0:58

particular one is called mini Shai Hulud

1:00

because it didn't affect as many

1:02

packages as the full Shai Hulud, but

1:04

it's the exact same type of worm. It

1:06

ended up affecting a very high-profile

1:08

NPM package, the TanStack. 42 packages

1:11

from TanStack, that's a lot. It also

1:13

affected Minstrel AI, UiPath,

1:15

OpenSearch, Guardrails AI, Dgraph Labs,

1:18

and others. Effectively, how it worked

1:20

is that it hijacked an OIDC token from

1:23

the action runners and poisoned the

1:25

GitHub Actions cache. This allowed them

1:27

to publish malicious versions through

1:28

real CICD pipelines, which means that

1:31

anybody looking at the versions, it

1:33

would be signed off and be like, "Hey,

1:34

yo, this release, it's good. Don't

1:37

worry, this is from an authoritative

1:39

source. You don't have to worry." So,

1:41

this is effectively what happened yet

1:44

again. Now, I want to make like a rant

1:47

here, okay?

1:48

I'm feeling a bit filled with some hot

1:51

energy, and I just feel like it's it's

1:53

time. It's time for me to talk about

1:55

things. And yes, part of this is going

1:57

to be the classic, right? You know the

1:58

classic.

1:59

>> Hey everybody, AN OLD MAN'S TALKING.

2:04

GRANDPA'S YOUR NAME. Which is me telling

2:07

you stories about the past, telling you

2:09

how it used to be and you guys going,

2:11

"Aw, cute grandpa. Why don't you go back

2:13

to the nursing home?" Which by the way,

2:15

hurts a little bit when you do that, but

2:17

you know,

2:18

that's just that because you know, just

2:20

to give you a little bit of JavaScript

2:21

lifetime for you. I've been working on

2:23

JavaScript since before there was a NPM

2:27

and or there was a way to even build

2:29

your JavaScript. Typically, what you did

2:31

is that either you wrote it in one big

2:33

file, you had a bunch of source

2:35

includes, or you do the classic, which

2:38

is build your own build tool, make it

2:39

all into one gigantic mega file, and

2:41

then put it forward in lots of global

2:43

state, absolutely fantastic. Along with

2:45

your file, you'd always of course rely

2:47

on jQuery cuz jQuery is the best query,

2:50

okay, buddy? Even my very first

2:52

professional job, I actually had to

2:54

build my own bundler. I built it in

2:56

Java. I know,

2:58

people, I was at a C# house. I built it

3:01

in Java and it bundled Microsoft master

3:04

pages JavaScript, okay? Do you do you

3:07

realize the do you realize the I

3:09

seen? You've heard me mention G2I before

3:11

for hiring great engineers quickly, but

3:13

did you know that they have roles for

3:15

full stack, front end, back end, iOS,

3:17

Android, data science, AI engineers,

3:19

platform engineering, site reliability

3:22

engineers, product design, product

3:24

management, and even security with

3:25

security engineers and security

3:27

analysts. But what I did not realize is

3:30

that they can help you build your entire

3:31

team. We're talking about product

3:33

management, project manager, designers,

3:35

and engineers, the whole shebang-a-bang.

3:37

So, use my name when you reach out to

3:39

them and get $1,500 off your first

3:42

invoice.

3:43

Ah,

3:44

>> [sighs]

3:44

>> out of breath for that one. I wanted to

3:46

say all that because again, the whole

3:48

grandpa thing, we're going to get

3:49

through that, but more so, uh I wanted

3:52

to kind of paint this picture cuz I feel

3:53

like we just got to have a good yapping.

3:55

So, I'm not going to really break down

3:57

the technical details of how Shai Halud

3:59

mini version 3.0 actually happened. This

4:03

isn't about this. This is more of a

4:05

philosophical talk, okay? Maybe a little

4:08

bit more of a come-to-Jesus talk, a

4:09

spiritual talk, all right? Because this

4:12

is what I see when I use npm. I see some

4:14

pretty intense security, okay? The npm's

4:17

making sure nothing gets through, okay?

4:19

Doing the utmost hardest work possible

4:22

to ensure your safety, and definitely

4:25

not that there's probably corporations

4:27

right now that are being blackmailed and

4:29

having in their information stolen, but

4:31

hey, whatever. Now, there's things you

4:33

can obviously do. So, just kind of like

4:35

some PSAs, you can always use pnpm. You

4:38

can have minimum release age, meaning

4:39

you don't get the newest libraries. But,

4:41

of course, what's the problem with the

4:42

newest libraries? If you don't get the

4:44

newest libraries, you could be releasing

4:46

stuff that has a major vulnerability.

4:48

Let's just say Next.js also had a huge

4:50

problem this week. Or, it's the inverse.

4:52

You get the new libraries, you get the

4:54

new security vulnerabilities. It's a

4:55

real damned if you do, damned if you

4:57

don't. Also, this is very, very

4:59

important. Block installation scripts by

5:02

default. Super, duper, duper important,

5:05

by the way. If you're on Rust, and

5:06

you're probably like,

5:07

>> [laughter]

5:08

>> "I use Rust." Well, buddy, hey, buddy,

5:11

guess what? I hate to break it to you,

5:13

but Rust has build.rs, and if you

5:15

download a package or you install a

5:18

dependency,

5:19

you're right, you're not had. But, the

5:21

second you build your project with a

5:23

dependency, if it has a build.rs file

5:25

that's malicious, bam, you're had. So,

5:27

it's inert to install, absolutely

5:29

dangerous to build. So, pretty much the

5:31

exact same worm theoretically could

5:33

exist anywhere. I do like what Gergely

5:36

has to say about this entire like, "Hey,

5:38

here's all the pros and cons. Here's the

5:40

things that are good. Here's the things

5:42

that are bad." Self-hosting your package

5:44

registry is pretty interesting because

5:45

you can choose what you want and don't

5:47

want inside of your registry and how old

5:50

or new they have to be. Okay, you could

5:52

pin versions, but of course pinning

5:54

versions often leads to a bit of

5:56

problems. You still have to rely on the

5:58

fact that the thing you're pinning

6:00

doesn't rely on a version range that

6:02

could be malicious for you. There's a

6:04

lot of problems with it. And

6:05

unironically, not even a part of this

6:08

entire Shy Halud thing, just yesterday

6:10

Ruby also pulled 120 malicious packages

6:14

from RubyGems. This is not like some

6:16

JavaScript problem. This is a larger

6:18

problem. And by the way, the mini Shy

6:20

Halud also went off and poisoned the

6:22

PyPI package registry. So, it also is

6:25

jumping ecosystems. But nonetheless,

6:27

none of that really matters. The problem

6:29

is a bit more broad. If you've only ever

6:32

used like say the JavaScript language,

6:34

you kind of have a certain view of the

6:36

world. And this can even extend that if

6:38

you've only ever used JavaScript and say

6:39

Rust, you kind of have the same view of

6:42

the world, which is all right, I have my

6:44

base programming language and inside of

6:46

it there's some conveniences around say

6:48

strings and arrays and all that. But

6:50

anytime I actually want to do something,

6:52

I have to go and get a package. Oh, you

6:54

want a URL? Well, guess what, Buster? If

6:57

you're in Rust, you got to get the URL

6:59

crate. Oh, you want a JSON stringify and

7:01

parse? Oh my gosh, you need Serde and

7:04

Serde JSON. Right? You're going to need

7:06

multiple packages for that. You want

7:08

async? You're going to have to have

7:10

something special for Rust. If you want

7:11

HTTP, you probably are going to both

7:14

need something for Rust and you're going

7:16

to want something for the JavaScript

7:17

ecosystem such as Express, Hono, Happy,

7:19

whatever you're going to do, right?

7:21

Elysium Elysium nuts on your chin. Damn,

7:24

that's crazy. Okay, anyways, back to the

7:27

story. Either way, anytime you want to

7:30

do a thing, you effectively need to go

7:33

and get a bunch of third-party

7:36

dependencies. Now, these third-party

7:37

dependencies, they often have the exact

7:39

same thing. Hey, I'm going to build HTTP

7:42

whatever, well, I'm going to go and rely

7:44

on a URL package. I'm going to go rely

7:46

on this certain async request thing. I'm

7:48

going to go rely on this certain other

7:50

thing internally. And so, even when you

7:52

download a package, that package has

7:54

many sub packages it depends on. That's

7:56

why whenever you just start any modern

7:58

JavaScript repo or start any Rust

8:00

project that even touches the internet,

8:03

you end up building like a hundred plus

8:04

dependencies just to get off the ground.

8:07

Now, this is where the philosophical

8:10

kind of debate starts because I just

8:11

wanted to put that in your head because

8:13

I think a lot of people, they don't

8:14

really realize the world they work in.

8:17

This is just always been the world that

8:19

exists. And I'm not even saying that

8:20

you're a bad person, a bad engineer, or

8:22

any of that crap, right? This is just a

8:24

natural state of working on the web is

8:26

that you probably went from JavaScript,

8:28

maybe you dabbled in a little bit of

8:29

Rust, maybe you got a couple of

8:31

thigh-high socks, maybe you had some and

8:33

very interesting questions and and

8:35

conversations with your parents. It's

8:37

like that's just totally the standard

8:39

ecosystem experience that everybody has.

8:42

But, there's other things in the world.

8:45

I've been in the process of rewriting

8:47

the Mordoria game in a different

8:48

language cuz I really wanted to give

8:50

something a little bit more run for the

8:52

money. I wanted to use both Jai, JAI,

8:54

Blow Lang as some people call it on the

8:55

Twitters, and Odin. is

8:59

a C-like programming language for the

9:01

joy of programming. That's what it's

9:03

called. And a very kind of cool part

9:05

about Odin is that, hey, I want to draw

9:07

textures and do 2D graphics. Well, guess

9:10

what? Raylib is just included. Now,

9:13

Raylib is obviously a C library, blah

9:15

blah blah blah blah, it has to do with

9:16

graphics, but it's a part of the

9:18

language itself.

9:20

When I run Odin, they have a vendored

9:22

set of libraries, which means that I can

9:24

also just type in vendor, and I can do

9:26

stuff with, say, lib C, Lua, X11, curl,

9:31

WASM, WebGPU. And that's kind of like an

9:33

interesting experience because that's

9:35

not the experience you would have in

9:38

other ecosystems. This language in some

9:40

sense is a complete language. It is a

9:43

batteries included all the way. So, if

9:45

you need something, it's probably

9:47

already been implemented in the standard

9:49

library or it's been vendored in in the

9:51

case of raylib or Lua integration.

9:54

Whatever you need for your game, this is

9:57

a language not only built as a general

9:59

purpose programming language but

10:00

designed to be extremely helpful to

10:02

people doing graphics. And that's like

10:05

kind of a unique selling perspective of

10:08

this.

10:09

Is that you actually have something that

10:10

is meant for a job and it does it well.

10:14

It's kind of like JavaScript. JavaScript

10:15

was really meant for a job. It was meant

10:18

to work on the web and that's why a lot

10:20

of the, you know, initial API also has

10:22

document which has, you know, get go,

10:24

you know, query selector, query selector

10:26

all and has a bunch of ways to interact

10:27

with the DOM. But then it also became a

10:29

general purpose language and then that's

10:31

where things just kind of got confusing.

10:33

It never really kept on iterating and

10:35

becoming more useful for the web because

10:37

it never really knew what it was. And

10:40

that's just the thing with Go as well.

10:41

Just use Go. Yes, this is

10:43

another one of those highly vulgar

10:46

articles in which goes over the reasons

10:48

why you should just use Go. And one of

10:50

the big reasons down towards the bottom

10:52

is that dependencies don't ruin your

10:54

weekend. You can A, you could add them

10:56

fairly easy, they're pretty

10:57

one-dimensional or you can actually just

10:59

vendor them in, meaning that they're

11:00

actually copied into your project. And

11:02

now this is where I'm going to say some

11:04

things that are

11:05

maybe a little bit more unique. I'm

11:07

going to go off the person who actually

11:09

created Odin the programming language,

11:11

Ginger Bill, and he has an article

11:13

called package managers are evil. Now,

11:15

you've probably seen me reference this,

11:17

I believe, in the last two videos that I

11:20

did on Shy Hello World and just the

11:23

ecosystem of npm over the last 6 months

11:26

ago or whenever it was. I actually

11:27

referenced this right here, which is

11:29

package managers are evil. And one of

11:31

the reasons why is that it really makes

11:33

simple something you should take so much

11:36

more seriously. Have you ever thought

11:38

about that? Like how much code you bring

11:41

onto your system? This is the exact same

11:44

problem we're seeing right now with

11:45

skills as well. People are just dumping

11:47

all these skills for their AI to use and

11:50

some of them have a bunch of like hidden

11:52

messages and ways to exfiltrate data

11:54

from your computer. Just like how, you

11:56

know, Shai Hulud is out there

11:58

exfiltrating all of your information.

12:00

It's the exact same thing is that we're

12:01

just kind of inundating ourselves with

12:03

so much information just to get started

12:05

on something. We're not really thinking

12:07

through the problems. We're not using an

12:09

environment that's been tuned for the

12:11

task at hand. Instead, we're using an

12:13

environment that's not really tuned for

12:15

it and that's that's, you know,

12:17

RIP JavaScript for all of its decisions.

12:19

It never really figured out what it

12:21

should have been. And even though the

12:23

language is pretty fun to use, pretty

12:25

easy to use, you can get quite a bit

12:26

done. It is a major flaw that it never

12:28

actually understood its purpose. And so

12:31

one of the big problems we end up

12:32

running into is this idea of automation

12:34

of dependency hell. See, the thing about

12:36

dependencies is every time you add a

12:37

dependency, you're adding liability to

12:39

your program, whether you like it or

12:41

not. Interfaces change, which makes it

12:43

hard to upgrade. If there's a security

12:45

vulnerabilities, then you have to

12:47

upgrade. You may have to upgrade to new

12:48

major versions. There's all sorts of

12:50

problems that are associated with it.

12:52

It's just not the same thing and when

12:53

something's in a package that you

12:55

download and use via NPM, you don't

12:57

really feel like you can touch it. And

13:00

often people never even review the code

13:02

itself. In fact, I did a poll not too

13:04

long ago that showed it was like 80 plus

13:06

percent of people don't even look at the

13:09

code that they're downloading all the

13:10

time. And I would I would suspect it's

13:12

actually probably significantly higher

13:14

than 80%. The only reason why I have 80%

13:18

on this channel is because we probably

13:19

cover more gaming and system stuff at a

13:21

higher rate than say a web dev channel.

13:24

But I just kind of wanted to think about

13:25

this, which is what happened? Why did we

13:27

change off of this? Because when I was,

13:29

you know, when I was a young man, when I

13:31

got started programming, okay, buddy? I

13:35

used to go in and I used to choose very

13:37

carefully what libraries I wanted

13:39

included inside of my JavaScript. I

13:41

remember one that was called like

13:42

something along the lines of

13:44

touch tools. It wasn't better touch

13:47

tools, which was a Mac thing. I forget

13:48

exactly what it was. This is back in

13:50

2012, and I would go to GitHub, I would

13:54

clone down the stuff, and I would vendor

13:56

in the exact versions, and then I would

13:58

hand-make edits to the things we needed

14:00

for my company, because this was still

14:02

MIT licensed back in the day, or

14:03

whatever the very permissive license

14:05

was. But nonetheless, I actually had to

14:07

kind of keep up with it. And was this

14:09

bad? Was this a bad thing when Bower

14:11

came out and NPM came out and Grunt came

14:14

out? Did we switch over and start

14:16

pulling it in? Sure, but was it bad that

14:17

we had to take a lot of thought before

14:20

bringing in any dependency? Well, I'd

14:22

say one big difference back then is

14:24

anytime you had a dependency, it almost

14:26

was itself dependency-free, because the

14:29

mechanism of getting dependencies was,

14:30

well, not very well understood.

14:33

And NPM really hadn't taken a foothold,

14:35

so anything you got was extremely

14:37

one-dimensional, which I think just

14:39

ultimately created very different

14:41

software 15 years ago than it does

14:43

today. And should we move back to that

14:45

day? Well, I do think that we are

14:48

entering into a world where we're just

14:50

going to see more and more of these Shai

14:52

Huluds. And part of that is because I I

14:55

mean, personally, I think that this

14:56

group behind it, they have so much

15:00

tokens and access to systems, we can't

15:03

even fathom it. And so, every 6 months,

15:05

they're like, "Well, should we hack them

15:06

again, George?" And then George is, of

15:08

course, very happy about this. "All

15:10

right, George. Let us

15:12

send off the tokens the token scams

15:14

again." And then off they go and grab

15:16

everything. And I think this is just

15:18

going to happen for the next, I don't

15:19

even know how many years. We're just

15:22

going to be perpetually had for like

15:24

every few months because of just how

15:26

fast everything updates. When a single

15:28

package is updated, potentially tens of

15:32

thousands of downloads happen within

15:34

just a few minutes going to all these

15:35

different CICDs, which then infect more

15:38

packages, and it just keeps on

15:40

happening. Like I would not be surprised

15:42

if right now the group behind Shia

15:44

Labeouf does not have access to a lot of

15:46

the major software companies right now.

15:49

Honestly, I refuse to believe that they

15:50

don't because it's ridiculous with how

15:52

much tokens they've been able to take.

15:55

Anyhow, I know this was kind of a bit of

15:56

a rambly video, and I know it was like a

15:58

little bit more high energy, and there

16:00

really wasn't that many jokes in this

16:02

video. But I mean, I just wanted to say

16:04

all those things because

16:05

you know, there's part of me that

16:06

realizes, especially as I use Odin,

16:09

like, "Wow, this is really nice. I'm

16:11

probably going to be able to finish off

16:13

this game, which will end up probably

16:14

being something like 100,000 plus lines

16:17

of code with zero dependencies. I have a

16:20

language, a build tool, and I have every

16:24

last like thing I need to be successful

16:27

completely in one item." And I'm just

16:30

like, "Why isn't this the way for

16:32

everything else?" Like this

16:33

is good. This is what more experiences

16:37

should be. I shouldn't have to like get

16:40

an amalgamation of software just to be

16:42

able to do the basic things. Like this

16:44

is what I want. This is what I want to

16:47

see more because I I've been on both

16:49

sides now. I like this side. I like this

16:52

side a lot, and if I really had to bring

16:54

in something, I could vendor it in

16:56

myself and be like, "Okay, I need this

16:58

one thing. It does this one thing. My

17:00

program wants it to do this one thing.

17:02

Here we go." Like and I'm just going to

17:04

make that choice so rarely because of

17:07

kind of the expensive nature because

17:08

guess what guess what Odin Odin doesn't

17:10

really have a package manager. I don't

17:12

know if you know that. I can't imagine

17:14

why Odin doesn't have a package manager.

17:16

I can't imagine well, why does Ginger

17:17

Bill not want a package manager inside

17:20

of Odin? I don't know where I was going

17:22

with all this. I just felt like yapping.

17:24

You know, like have you ever had that

17:25

urge? I had the urge. I feel like I

17:27

understand why a dog wants to bark

17:29

because I I just feel the same thing

17:31

just deep inside of my bones.

17:33

Did you like this? You want to like send

17:36

send me a signal that you liked it.

17:37

Press like the like button or make like

17:38

a comment and tell me I'm completely

17:40

wrong and just being an old man yelling

17:42

at clouds or maybe I'm correct. Maybe

17:44

having a language in which actually does

17:47

just have everything included is the

17:50

better way to go. The name

17:53

is the primogen.

Interactive Summary

The speaker expresses frustration and a sense of vindication regarding security issues within the JavaScript ecosystem, specifically discussing a new worm called "mini Shai Hulud." This worm hijacks OIDC tokens and poisons GitHub Actions caches to publish malicious package versions. The speaker criticizes the prevalent dependency-heavy model in JavaScript (and to some extent Rust), where even basic functionalities require numerous third-party packages, leading to increased security risks and maintenance burdens. He contrasts this with languages like Odin and Go, which offer more "batteries included" standard libraries and promote vendoring dependencies, reducing reliance on external package managers and encouraging more careful consideration of included code. The video concludes by suggesting that a future with more integrated language features and fewer external dependencies might be a safer and more efficient approach, especially given the continuous threat of supply chain attacks.

Suggested questions

5 ready-made prompts