WEBVTT

00:00.990 --> 00:02.810
Hello, my name is Michael Schrenk.

00:02.810 --> 00:07.170
I live in Las Vegas, Nevada, where I write botnets for a living.

00:07.170 --> 00:09.250
And I'm here to talk about malware.

00:09.250 --> 00:10.770
Thanks for coming to my talk.

00:10.850 --> 00:23.430
So I said I write botnets, and what that basically means is that I write distributed systems that do data extraction, we do automation, we do analytics.

00:23.430 --> 00:30.910
But one thing that we get to do a lot more than probably most people is look at other people's code.

00:30.910 --> 00:34.830
It's because we download webpages and we have to write parsers for them.

00:34.830 --> 00:39.450
So we get to look at a lot of source code.

00:39.450 --> 00:50.310
And one of the things that I've noticed, I've been doing this now since the mid-90s, and I've noticed that people are using JavaScript differently than they did even 10 years ago.

00:50.430 --> 00:51.930
So that's what this is about.

00:51.930 --> 00:58.170
And I believe that JavaScript is being used in a dangerous way that can be used as an attack vector.

00:59.530 --> 01:08.470
So one of the things I did to get a better idea of how people are using JavaScript, you know, if I'm just looking at files randomly, that means one thing.

01:08.470 --> 01:16.110
But to go off and look at 1,000 of the top websites and see how they use JavaScript would be a really useful thing.

01:16.110 --> 01:17.130
So I did that.

01:17.130 --> 01:26.690
I wrote a bot that goes out and looks at a list of 1,000 websites, analyzes their homepage for how they are using JavaScript.

01:26.690 --> 01:28.650
And that's part of this talk.

01:29.390 --> 01:31.990
But here's really what we're going to discuss.

01:31.990 --> 01:43.090
We are going to discuss this thing that I'm calling third-party JavaScript, which is... there we go, get my... it's like this stuff that we're talking about right here.

01:43.110 --> 01:54.710
It's these little scripts that people include in their HTML that brings in external JavaScript libraries like jQuery, Google Charts, you name it.

01:54.710 --> 01:57.010
There are a lot of these that people are using.

01:58.550 --> 02:05.810
And I believe that these third-party JavaScript files are an attack vector, and I'm going to show you why.

02:05.950 --> 02:15.900
I'm going to give you examples, and I'm also going to teach you ways that you can use these third-party files in a much, much more secure environment.

02:17.070 --> 02:26.590
So one of the things that I want to make very clear here is that I do not believe that JavaScript itself is a threat.

02:26.590 --> 02:34.560
I believe that the way people use JavaScript is a threat, and the way they're using it creates opportunities for attack vectors.

02:35.960 --> 02:42.900
So, before we look at the threat, we need to figure out what exactly JavaScript is capable of doing.

02:42.980 --> 02:46.920
Well, it's basically capable of doing two things.

02:46.980 --> 02:52.460
As you probably know, if you're a developer, you know that JavaScript operates on the DOM.

02:52.660 --> 02:58.720
So anything on a web page, JavaScript pretty much has access to it, with a few exceptions.

02:58.900 --> 03:04.140
But basically, it can not only have access to it, but it can also change things on the website.

03:04.220 --> 03:11.780
The other thing it can do is JavaScript can communicate with other servers, right, using Ajax-y kind of technologies.

03:11.980 --> 03:20.300
Also, if you are downloading the library from an external server, you're also leaving server logs, right?

03:20.300 --> 03:38.440
So my guess is that if you went to any of these big framework suppliers, like jQuery or Angular, if you looked in their log files, you could learn a lot about the people who are using their libraries, just from the metadata that becomes created.

03:38.500 --> 03:45.280
The other thing you might say is that JavaScript, that's not dangerous, that's just like HTML, right?

03:45.280 --> 03:47.100
No, it is actually dangerous.

03:47.100 --> 04:02.140
There have been over 40,000 known examples of JavaScript malware that have not only been documented, but they're available for you at this website, at GitHub, the address is in the URL.

04:02.500 --> 04:07.880
And you can go there and you can download them, you can play with them, you can study them, you can do whatever you want to with them.

04:07.960 --> 04:09.760
But they do exist.

04:10.320 --> 04:17.880
So what exactly am I talking about when I refer to a third-party JavaScript file?

04:17.880 --> 04:20.540
Well, there's two different things that I'm referring to.

04:20.540 --> 04:26.920
One are files that are truly third-party and truly remote.

04:26.920 --> 04:29.820
That would include examples like the one over here.

04:29.820 --> 04:31.020
I got to get this down.

04:31.020 --> 04:32.020
Right over here.

04:32.860 --> 04:41.660
You're just making a JavaScript request to bring in or to include another JavaScript file that you will reference later.

04:41.800 --> 04:49.720
The other example would be a file that's running off of your own server, but it's one that you didn't write.

04:49.720 --> 04:56.820
So in other words, you went and you downloaded somebody's library, threw it on your server, referenced that, and that's the file that you're using.

04:56.820 --> 05:05.320
As far as I'm concerned, if you don't do anything else, these are both third-party JavaScript files, and they can both cause some trouble.

05:07.380 --> 05:18.680
The other problem is that when you're using somebody else's code like this, you are doing it without any kind of source control whatsoever.

05:18.680 --> 05:26.580
Now, I think to some degree, the whole notion of source control is a little bit generational.

05:26.680 --> 05:40.200
And I'm going to say that because I did a very similar talk a few years ago in Sofia, Bulgaria, and I was at the Code Monsters Java 2 Days conference.

05:41.140 --> 05:50.240
And I was talking to a room of probably, I don't know, 1,500 people or so, and I asked for a rising of hands.

05:50.240 --> 06:00.420
How many people were developers who have developed code not for the internet, not for a web application?

06:00.560 --> 06:05.560
Of all the people in that room, I maybe saw five or six hands come up.

06:05.560 --> 06:10.740
And they were mostly older people like myself who had worked in other areas.

06:12.880 --> 06:15.640
Web development is a little different apparently.

06:15.760 --> 06:23.560
A lot of what we would consider traditional DevOps don't seem to apply anymore.

06:23.560 --> 06:25.120
One of them is source control.

06:25.440 --> 06:27.940
So what is source control?

06:28.340 --> 06:36.200
Well, source control is a number of things, but it assumes that you validate your production software.

06:36.240 --> 06:40.000
That's kind of basic in source control.

06:40.000 --> 06:45.620
The other thing is that it assumes that you freeze your code before you do your validation.

06:47.720 --> 06:53.060
You also need to prove that your code hasn't changed while you're validating it.

06:53.060 --> 06:57.020
So in other words, somebody makes a quick fix that may affect other things.

06:57.020 --> 06:59.360
So you probably want to look at other things too.

07:00.540 --> 07:04.700
The other thing is that you only want to release production quality software.

07:07.420 --> 07:10.900
And you only make changes to known good code.

07:10.900 --> 07:13.880
Those are the things that happen with source control.

07:13.940 --> 07:22.900
Now when you're kind of importing somebody else's code into your software, not a whole lot of this happens.

07:22.940 --> 07:25.040
Not a whole lot of this happens.

07:25.980 --> 07:29.560
The other part of source control is version control.

07:29.560 --> 07:36.640
And version control basically says that you're able to go back to a prior version if you need to, or several versions back.

07:36.640 --> 07:42.120
But you're able to keep track of changes in an orderly fashion.

07:42.180 --> 07:49.840
Again, this is not something that happens when you're just loading in other people's files that basically they're maintaining.

07:50.900 --> 07:52.020
Okay.

07:56.180 --> 07:59.160
So why are third-party libraries a problem?

07:59.640 --> 08:04.760
Well, the other problem is that they're used without any kind of validation, generally.

08:05.520 --> 08:08.260
And there are reasons for this.

08:08.280 --> 08:10.360
You ever look at the code you import?

08:10.480 --> 08:15.840
A lot of the code that you download is machine-readable only, and it's not meant for human eyes.

08:15.840 --> 08:19.080
So it's very difficult to validate.

08:19.600 --> 08:29.200
I also hear a lot of people say, and I mentioned this a little bit earlier, people say, web apps are hard to validate because, well, they're just different.

08:29.380 --> 08:30.420
They're just different.

08:30.420 --> 08:35.300
For example, you don't control the choice of browser.

08:35.380 --> 08:35.680
Okay?

08:35.680 --> 08:40.900
Unless you only allow one browser, you really don't control what browser they're using.

08:40.900 --> 08:50.020
So if you are writing a bunch of server-side code, you are running your code in an environment that you don't know a whole lot about.

08:50.020 --> 08:53.620
So it's really hard to validate your code in situations like that.

08:53.800 --> 08:55.540
Also, you don't control the hardware.

08:55.540 --> 08:57.440
You don't know if they're running on a phone.

08:57.480 --> 08:59.660
You don't know if it's a phone from the 90s.

08:59.660 --> 09:02.920
You don't know if they're running it on a big gaming console.

09:02.920 --> 09:04.580
You have no idea what they're running it on.

09:05.280 --> 09:10.200
The other thing is that you don't know what they're doing with their browser, again.

09:10.320 --> 09:18.220
You know, your code might run differently if they have 40 tabs open, all running very complex Google charts or something.

09:19.440 --> 09:22.480
You really don't have control over that kind of stuff.

09:23.640 --> 09:35.600
So to a real extent, web development is different than other kinds of development, but we shouldn't lose sight of what we're doing.

09:36.240 --> 09:38.680
And then some people might say, source control?

09:38.780 --> 09:40.300
We're an Agile shop.

09:40.300 --> 09:41.840
We don't do source control.

09:41.900 --> 09:50.420
Well, you might have even more need to do source control if you're in an Agile shop, especially version control, because things are going to be changing more often.

09:50.420 --> 09:54.220
And you definitely can do source control with Agile.

09:55.480 --> 10:01.480
The other thing people might say is that, well, there's nothing mission-critical on our website.

10:01.480 --> 10:02.860
So we really don't care.

10:02.860 --> 10:06.960
I mean, there's not much that could happen.

10:06.960 --> 10:09.240
It's like, yeah, that's probably true.

10:10.540 --> 10:16.780
I just want to show you an example of a JavaScript trojan called, you are an idiot.

10:20.780 --> 10:26.140
So this is a short example of what this trojan does.

10:26.340 --> 10:40.640
It's completely harmless outside of the fact that it creates this big visual thing on your display, which is not something that you would probably want on a corporate website or for your organization in general.

10:41.060 --> 10:46.740
Not only do these little boxes appear, but they grow in number and they also sing to you too.

10:46.740 --> 10:50.420
They also say you are an idiot and they all say this in chorus.

10:50.520 --> 10:52.580
So it's quite the thing.

10:52.580 --> 10:53.880
You don't really want this.

10:53.880 --> 10:56.260
And again, this is a JavaScript exploit.

10:58.880 --> 11:06.260
So web development is unique, but you always want to be able to release stable code, right?

11:06.260 --> 11:12.100
And you want to make sure that the code you're releasing stays stable and not subject to change.

11:12.100 --> 11:16.120
You also want to be able to revert to other stable versions.

11:16.720 --> 11:23.860
But regardless of the nature of web development, source control is quite, quite important.

11:25.140 --> 11:32.280
And the more important your software is, the more important validation and source control become.

11:34.520 --> 11:44.340
Now, one of the problems with all this is that the libraries that people are importing are just so attractive that people just want to use them.

11:44.600 --> 11:48.400
And these are things that you probably would not want to write on your own.

11:48.400 --> 11:51.980
For example, frameworks, jQuery in particularly.

11:52.140 --> 11:54.420
I mean, it's incredibly useful.

11:54.860 --> 12:00.080
It just needs to be used with proper DevOps.

12:00.360 --> 12:04.820
Again, other libraries, Google Analytics, Chart, AdSense.

12:04.820 --> 12:06.100
Chart is my favorite, by the way.

12:06.100 --> 12:07.440
I use that all the time.

12:09.260 --> 12:14.520
These are not JavaScript apps that you really want to write your own.

12:15.260 --> 12:16.300
You really don't.

12:16.300 --> 12:18.000
You want to use somebody else's.

12:18.000 --> 12:20.360
And these are very capable libraries.

12:20.360 --> 12:21.520
And that's why people use them.

12:21.520 --> 12:23.420
They're just so attractive.

12:23.680 --> 12:37.280
But when you use these libraries, the assumption is that they come fully debugged and that the admins use proper source and version control, and also that they're free of exploits.

12:37.280 --> 12:40.780
We assume that they are free of exploits.

12:41.040 --> 12:45.920
And that's something we probably wouldn't do with the rest of our code.

12:45.920 --> 12:48.420
But for some reason, that happens with JavaScript.

12:48.420 --> 12:52.580
In many cases, the code that people import is very significant.

12:52.580 --> 13:02.560
And let's just look at my survey here to find out what exactly people really do with JavaScript.

13:02.820 --> 13:04.720
So how was the survey done?

13:04.920 --> 13:12.900
Well, I looked at the home pages of a Google list that I found, Google's top 1,000 websites.

13:13.840 --> 13:20.200
How effective that is in identifying the top 1,000 websites, I really don't know.

13:20.780 --> 13:25.400
I'm really not even that concerned because the list itself is pretty arbitrary.

13:25.400 --> 13:27.880
I just wanted to have a list that people could reference.

13:28.120 --> 13:31.520
And again, I just looked at the home pages for this study.

13:31.600 --> 13:38.060
I did not include looking at scripts that the JavaScript also imports, because that's another thing that happens.

13:38.060 --> 13:43.460
You import one JavaScript file from some server, and it imports five others.

13:43.460 --> 13:45.640
You really have no control over that.

13:47.240 --> 13:51.720
So again, the survey came from a list that I found from Google.

13:52.100 --> 13:54.720
It's an international list, which is good.

13:55.400 --> 13:59.220
And like I said, this list is probably pretty arbitrary.

13:59.240 --> 14:04.480
It's probably not that much different than what you would find from something from Alexa or somebody like that.

14:05.220 --> 14:17.400
From those 10,000 web pages that I looked at, just the home pages from those, I found over 4,100 unique imported JavaScript files.

14:17.420 --> 14:23.700
I also found that almost 75% of those websites use JavaScript.

14:25.520 --> 14:28.300
And my number is pretty consistent with other people's.

14:28.300 --> 14:30.220
This is another person's study.

14:30.400 --> 14:35.460
And again, I don't know what websites they looked at, but they got a number that was slightly higher than mine.

14:35.460 --> 14:42.740
So I think 75 to 90 is probably a pretty close percentage of how many websites are using JavaScript.

14:42.860 --> 14:55.760
Of the websites that I looked at, those 1,000, they averaged 6.5 JavaScript files, imported JavaScript files per home page.

14:57.620 --> 15:05.420
Two of the sites that I looked at imported over 100 separate JavaScript files just on their home page.

15:05.420 --> 15:06.740
Can you imagine that?

15:07.200 --> 15:09.460
That's the most I've ever seen.

15:09.740 --> 15:19.760
Now this is the number that should probably stick with us, and that is 60% of the websites that we looked at imported third-party JavaScript from another domain.

15:19.760 --> 15:23.280
And those are the ones that I think are probably the most dangerous.

15:23.300 --> 15:24.760
What are people using?

15:24.760 --> 15:29.160
To nobody's surprise, a lot of people are using jQuery.

15:29.360 --> 15:32.840
I'm surprised that React and Angular aren't a little more popular.

15:32.840 --> 15:34.000
I thought they were.

15:34.220 --> 15:37.980
But again, this is primarily corporate websites.

15:37.980 --> 15:40.160
Other people may be doing other things.

15:40.260 --> 15:42.920
Again, like I said, my list is pretty arbitrary.

15:43.500 --> 15:45.920
A lot of people are using Google AdSense.

15:45.920 --> 15:47.160
That makes sense.

15:47.220 --> 15:50.920
My favorite, Google Chart, wasn't terribly popular.

15:52.680 --> 15:58.140
So to understand what we're really talking about here, let's take a history lesson.

15:58.140 --> 16:05.400
Let's go back to 1995, the static web, and look at how things were done then.

16:05.400 --> 16:08.920
Well, then you'd sit in front of a terminal.

16:08.920 --> 16:11.120
You'd request a web page through your browser.

16:11.120 --> 16:13.800
It would bring back HTML.

16:13.880 --> 16:21.520
Your browser would parse the HTML, look for other media, go get that media, bring it back, and render the web page.

16:21.520 --> 16:25.680
Well, we still do all those things today.

16:27.380 --> 16:34.700
But today, we also, in addition to images, we also go out and we download JavaScript.

16:35.260 --> 16:37.340
From anywhere on the internet.

16:37.340 --> 16:40.220
It could be all kinds of domains from all over the place.

16:40.220 --> 16:43.180
Most people don't really pay that much attention.

16:43.520 --> 16:49.300
But this stuff is coming from an external source, and that's why we should be taking this very seriously.

16:49.760 --> 16:57.240
Because these libraries that are imported are seldom validated by the developer who is importing them.

16:58.620 --> 17:00.600
They generally have no source control.

17:00.600 --> 17:06.160
Well, you have no source control because you're relying on somebody else to do it, and they may or may not be doing it.

17:07.880 --> 17:11.700
And you also don't have control over their server configurations.

17:11.740 --> 17:16.880
Now, this probably isn't a big deal if you're talking about Google or Amazon, one of the big players.

17:16.960 --> 17:21.020
But some of the smaller ones, do you know that they're patching their server?

17:21.120 --> 17:23.060
Do you know what kind of server they're using?

17:23.500 --> 17:25.020
You don't know any of this stuff.

17:25.020 --> 17:29.060
You're basically trusting that their server configurations are good.

17:29.060 --> 17:30.540
They're always going to be up.

17:30.540 --> 17:34.900
And again, these are not things you do when you control your source.

17:34.900 --> 17:37.040
You don't do any of those things.

17:37.180 --> 17:40.240
So what, what kind of threats are we really looking at here?

17:40.620 --> 17:42.600
Definitely bandwidth stealing.

17:42.980 --> 17:54.740
I'm going to give you an example that's actually not a JavaScript example, but it makes a really good point about how JavaScript is, or how bandwidth is stolen in this kind of a context.

17:55.620 --> 17:59.200
There was a developer who came up with a URL shortener.

17:59.200 --> 17:59.620
Okay.

17:59.720 --> 18:21.320
And if you know what URL shorteners are, if you want to send a link to a friend, either in social media or through email or something, and it's a really long link, sometimes you use a shortener that'll give you a short little link that you can use that will be expanded into your full link once they click on it and go to the site and are redirected and whatnot.

18:21.480 --> 18:25.960
Well, somebody wrote one of these that worked beautifully and became very popular.

18:26.100 --> 18:39.600
But in addition to doing the expansion of the link and redirecting them to the correct webpage, it would also do insert a little bit of JavaScript that would do a denial of service attack on some target.

18:39.600 --> 18:40.160
Okay.

18:40.980 --> 18:46.740
Clever, clever exploit, but these are the kinds of things that can happen with bandwidth stealing.

18:47.760 --> 18:51.260
JavaScript is also used, by the way, in that case.

18:52.620 --> 19:02.300
The other threats are privacy violations, because JavaScript can look at DOM and it can create analytics.

19:02.740 --> 19:14.650
And like I said earlier, just downloading these libraries from another server provides a lot of metadata that really creates opportunities for security violations.

19:16.780 --> 19:26.520
The other thing are phishing attacks, and phishing attempts are probably the most dominant forms of attacks at this point.

19:26.520 --> 19:28.520
And they can also be done through JavaScript.

19:29.960 --> 19:30.680
All right.

19:30.680 --> 19:33.080
Now here's another example I wanted to give you.

19:34.200 --> 19:42.160
This is a case where somebody developed a tutorial for Google Analytics, and they also gave you a link to the code.

19:42.160 --> 19:43.220
How convenient.

19:43.340 --> 19:48.880
The only problem is the URL they gave was the wrong URL.

19:48.940 --> 19:52.900
It looked very much like the real URL, but it wasn't.

19:52.980 --> 20:06.020
So basically, this person just taught you how to use Analytics, and now you're using that person's version of Analytics, and they basically have all of your web traffic data.

20:06.500 --> 20:10.900
Plus, they could also modify the code and inject some other stuff in there, too, if they'd want.

20:12.080 --> 20:16.060
So you don't, again, it's important to do source control.

20:18.300 --> 20:35.530
Well, the other threat is that since server-side code runs on your machine, it doesn't run on the server, it runs on somebody else's machine, you are essentially giving people the opportunity to run arbitrary JavaScript code on a lot of users' machines.

20:37.850 --> 20:41.910
There can also be bugs and stuff, and bugs and exploits.

20:41.910 --> 20:50.590
It wasn't that long ago there was a zero -day in jQuery, and apparently this thing had been out there for about three years.

20:50.790 --> 20:57.870
So, again, this is what happens when you don't control your own source code.

20:58.570 --> 21:03.710
So what are some other possible attack vectors if you're using third-party JavaScript?

21:04.210 --> 21:14.110
Well, things that can happen are after your site is running nicely and everything looks good, the owner of the library that you're using could decide to change the code.

21:14.150 --> 21:20.310
And it might be a bug fix, it might be an update, or maybe it's something more deviant.

21:20.750 --> 21:23.210
That possibility exists.

21:23.210 --> 21:26.890
And if that possibility exists, it will at some point happen.

21:26.890 --> 21:28.590
Here's another possibility.

21:29.290 --> 21:40.330
The owner of the repository that you're using gets hacked, and somebody either changes the code, or maybe the server just goes down, right?

21:40.330 --> 21:42.790
Part of security is availability.

21:42.810 --> 21:49.310
If these remote servers go down, again, to no fault of your own, that creates an issue.

21:49.730 --> 21:52.250
Those are other attack vectors.

21:52.370 --> 21:55.610
Other things that can happen, you can have things happening with DNS.

21:55.630 --> 21:59.710
Somebody can poison DNS, send you off to a different library.

21:59.750 --> 22:01.370
There can be DNS spoofing.

22:01.370 --> 22:06.470
There can also be some social engineering that happens that could get people to use the wrong libraries.

22:06.890 --> 22:15.250
Some other things that you open yourself up to are poor source control used by the person who maintains the repository that you're using.

22:15.370 --> 22:18.290
You can run into cross-site scripting issues.

22:18.710 --> 22:22.670
All the common exploit types happen here, too.

22:22.670 --> 22:24.450
You can have man-in-the-middle attacks.

22:24.450 --> 22:29.470
You can have API credentials sent out in clear text.

22:29.590 --> 22:34.830
I've seen that happen even on pretty legit JavaScript apps.

22:35.570 --> 22:47.110
Anyway, I don't want to discourage people from using JavaScript, or even discourage people from using some of these nice frameworks and stuff that people use, but I really would like to encourage people to use them safely.

22:47.110 --> 22:51.590
How do you safely use JavaScript?

22:52.610 --> 22:58.230
Well, one way to do it is you can download these libraries and store them locally.

22:58.310 --> 23:01.890
That at least gives you control of the source.

23:01.890 --> 23:06.130
You know it's not going to be changing, and you know the environment that it's in.

23:06.690 --> 23:10.970
Now, if you do this, you might violate some license agreements that you have.

23:10.970 --> 23:12.330
Check with that first.

23:12.630 --> 23:18.990
Sometimes this isn't even a possibility, because the files need to be remote.

23:18.990 --> 23:25.050
They might need to access some resource that is only available remotely, and not available on your server.

23:26.030 --> 23:30.650
And also, doing this removes any DNS issues that you might be concerned about.

23:31.750 --> 23:37.810
Another thing you might try to do is to sandbox your script in an iframe, or a frame of some type.

23:37.810 --> 23:39.850
That might be useful for you.

23:39.850 --> 23:50.470
Another thing you might want to look at is using SRI, which is a method to validate that the source and the host and everything is correct.

23:50.830 --> 23:59.120
I really haven't seen many people do this, and I'm actually not sure how common this is, to be absolutely honest.

24:00.870 --> 24:09.070
The one thing I recommend all organizations doing is never, ever, ever host your website on your own network.

24:09.230 --> 24:12.250
Always get it provided by a hosting company.

24:12.490 --> 24:18.990
The reason there is if your website does get broken into, they don't have a path to your network.

24:19.630 --> 24:22.970
It's all sitting someplace remotely, and that's where it should be.

24:23.230 --> 24:25.330
Keep private things private.

24:25.870 --> 24:27.810
Let public things be public.

24:27.810 --> 24:29.170
Don't mix the two.

24:32.010 --> 24:36.110
The other thing that would be a good thing for you to do is to track changes in the libraries.

24:37.250 --> 24:39.370
And I don't know how often people do this.

24:39.370 --> 24:48.570
So in other words, if you're using a specific version of a library, make sure they don't do the updates for you.

24:48.790 --> 24:51.590
In other words, they might make changes and not tell you about it.

24:52.410 --> 24:55.890
You need to be able to track changes on any of these libraries that you're using.

24:57.070 --> 25:06.670
And finally, I would ask for you to ask yourself if you really need the functionality that this JavaScript library is providing.

25:07.550 --> 25:12.290
Do you need that submit button with the rounded edges?

25:12.610 --> 25:13.930
Maybe you don't.

25:13.930 --> 25:19.110
Maybe you could write what you need to write in pure JavaScript and not have to import those things.

25:19.110 --> 25:22.550
That would be wonderful, and it probably would be a lot more secure.

25:24.630 --> 25:34.010
Also, keep in mind that JavaScript is not alone here, and that there are other threats around other third-party things like Flash.

25:34.010 --> 25:35.590
Some people still use Flash.

25:35.590 --> 25:41.170
PDFs, videos, and yes, even images can cause issues.

25:41.170 --> 25:48.970
And if you're curious about the kinds of issues that images can create, check out my DEF CON 15 talk.

25:48.970 --> 25:50.650
It should be on the server.

25:50.750 --> 25:58.890
The fabulous executable image exploit, where I talk about how you can have images running arbitrary code on people's servers.

25:59.990 --> 26:04.390
So in conclusion, what have we learned?

26:04.430 --> 26:07.950
We have learned that JavaScript is awesome.

26:07.950 --> 26:09.410
It's not going away.

26:09.430 --> 26:14.850
These libraries are just too functional and too hard to ignore.

26:14.850 --> 26:16.230
People are going to use them.

26:16.230 --> 26:20.350
We just need to find more safe ways of using them.

26:21.330 --> 26:36.730
We've learned that source control is a vital part of DevOps, and if you're not doing source control on your entire project, you're not doing software or you're not doing source control really for your project at all.

26:36.730 --> 26:45.730
A lot of developers are using JavaScript that they really don't control, and we've also learned that most developers don't validate imported libraries.

26:45.730 --> 26:47.030
They just use them.

26:47.230 --> 26:52.090
You know, you get that jQuery calendar working, that's usually good enough for people, right?

26:52.890 --> 26:58.790
They don't do boundary testing and all the other kind of classic stuff that is involved in software testing.

26:59.170 --> 27:03.250
These scripts that people are importing can be used as attack vectors.

27:03.250 --> 27:04.810
I've demonstrated that.

27:05.370 --> 27:11.930
And we've learned that there are ways to minimize your risk when using imported JavaScript libraries.

27:14.630 --> 27:21.930
So, thank you, and I just want to leave you with one final message, which is good DevOps can solve a lot of security issues.

27:21.930 --> 27:22.870
Thank you very much.

27:22.870 --> 27:23.990
I really enjoyed this.

27:23.990 --> 27:24.710
Thank you.

