one wrong npm package

  Рет қаралды 183,370

PwnFunction

PwnFunction

Күн бұрын

Пікірлер: 214
@PwnFunction
@PwnFunction 3 жыл бұрын
My bad, it's "Almost everything is an object".
@rebelsdeveloper367
@rebelsdeveloper367 3 жыл бұрын
hehe .. me not like use front end server thou
@ZainAli-uq3fj
@ZainAli-uq3fj 3 жыл бұрын
@@daruiraikage he meant almost everything in Javascript is an object.
@unknownnn5479
@unknownnn5479 3 жыл бұрын
"dont let the feminists see this" haha ... btw really cool work brother
@eduardoblas2315
@eduardoblas2315 3 жыл бұрын
So... everything in python is a cat ;)
@btccricket14
@btccricket14 2 жыл бұрын
I watched 2 of your videos and I realized how fucked we're gonna be when the world goes full digital.....
@chairlovawitabat
@chairlovawitabat 3 жыл бұрын
Subscribed to your channel a while ago because you discussed interesting topics outside of my primary area of interest. As a front end React developer, I'd never thought I'd see a video on your channel that cut so close to home. This is absolutely excellent information to know. omg thank you so much for this video!
@RodrigoMallmann1
@RodrigoMallmann1 3 жыл бұрын
Totally agreed! This video earned him my sub. Interesting to watch his other videos.
@Bingomad8383
@Bingomad8383 3 жыл бұрын
This channel is gonna touch millions soon. Every video you create makes me curious about how it all can be broken down and easily hijacked. i love the graphics , very neat and clean.
@hesh1700
@hesh1700 3 жыл бұрын
1 question. "How?" That's a lot of content to keep track of to make this work. Seriously though, your work is awesome and I learned a lot from it.
@dealloc
@dealloc 3 жыл бұрын
This was a proof of concept. The real vulnerability shown is the property pollution and how it can be exploited in cases where user input isn't sanitized before being passed into library code that isn't safe. The proof of concept was just an example of what could happen in a specific case where Next.js and AMP was used, that would pass query parameters directly into the getServerSideProps through the unflatten function, as a way to run arbitrary code on the web server.
@hesh1700
@hesh1700 3 жыл бұрын
@@dealloc Thanks for the clarification. I Really appreciate it, but still I'm amazed of people who actually discover these exploits or vulnerabilities for the first time. How they think, how they do stuff amazes me.
@mogwai888
@mogwai888 3 жыл бұрын
@@hesh1700 inspiration from other vuln types, knowledge of building/coding stuff from scratch (you're a dev) and the time to sit around playing with things your interested (or are paid well) to research.
@aditya.khapre
@aditya.khapre 3 жыл бұрын
In the end, the attached HAS to pollute the code on the server for this to work.
@Lupinicus1664
@Lupinicus1664 3 жыл бұрын
This is excellent work. So refreshing to find a clear, concise description of tricky topics. Thank you for the work this video took, it was well worth it.
@jemesmemes9026
@jemesmemes9026 3 жыл бұрын
there’s fun depth to the “everything is an object” thing, basically amounting to “mostly everything is an object”
@shanek.6293
@shanek.6293 2 жыл бұрын
This genuinely is the only thing that made me understand objects. Thank you so so much!
@dhyeychoksi5178
@dhyeychoksi5178 3 жыл бұрын
Appreciate your work man! Nice video
@jeschinstad
@jeschinstad 2 жыл бұрын
This channel is _awesome_ man! I've just discovered it and I love it! Great work.
@FedoraRose
@FedoraRose 3 жыл бұрын
Finally a new video I always learn so much
@cliffclof
@cliffclof 3 жыл бұрын
This is a great example. Will def be thinking about properly blocking prototype chain traverse while coding.
@blakek13
@blakek13 2 жыл бұрын
Excellent video and explanation! In my opinion, prototype issues shouldn’t be the module’s issue (i.e flat isn’t vulnerable). It’s the incorrect usage of the module that causes the vulnerability. This is like saying a MySQL library is vulnerable because it allows the programmer to pass unsanitized user input. Putting this responsibility on the module is something I’ve noticed more in JS since npm started it’s automatic “audits” on module installs.
@MarekWojt
@MarekWojt 3 жыл бұрын
> "everything is an object" > getting "undefined is not an object" all day long
@FlorianWendelborn
@FlorianWendelborn 3 жыл бұрын
Fun fact, you used to be able to overwrite undefined to a different value in JS... IIRC it was just window.undefined = true and suddenly everything breaks down
@CrashCubeZeroOne
@CrashCubeZeroOne 2 жыл бұрын
Pwn: a class is basically a structure. C#: so a structure is basically a class.
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 3 жыл бұрын
I liked your presentation and animation skills
@cat-.-
@cat-.- 3 жыл бұрын
Lol I have always thought prototype pollutions as an annoyance but you have shown that batshit libraries can make it basically an RCE, goddamnit
@maxwax7958
@maxwax7958 3 жыл бұрын
Great content an keep it up 💪
@wtfdoiputhere
@wtfdoiputhere 3 жыл бұрын
Being someone who recently figured out OOP in JavaScript and wrote a blog to share my knowledge, i rly loved this vid and it made soooo much sense to me
@divzthepro9937
@divzthepro9937 2 жыл бұрын
A class is like a blue print meanwhile a object is a building i guess
@az.tek.00
@az.tek.00 3 жыл бұрын
missed ya, master pwnfunction. thx for the post. happy holidays. 🌟
@PwnFunction
@PwnFunction 3 жыл бұрын
Happy holidays to you too :)
@xenialxerous2441
@xenialxerous2441 3 жыл бұрын
Hey! Awesome video btw. Loved it thoroughly 🙌🎉
@lljw9455
@lljw9455 2 жыл бұрын
Binge watching your vids! Great content btw💕
@gimmethedata4256
@gimmethedata4256 3 жыл бұрын
How well does the automated search for exploits actually work? What is the chance that a given exploit is detected? What I do know out of experience is that most exploits have been there for a pretty long time, and that 'there always are exploits'.
@dealloc
@dealloc 3 жыл бұрын
It scans for already known vulnerabilities. While there are ways to use somewhat scan for possible vulnerabilities with static analysis and checking for common flaws. But the best known solution is to check against a database of known vulnerabilities, that have been discovered and reported by people.
@gimmethedata4256
@gimmethedata4256 3 жыл бұрын
@@dealloc Hm well now I think of it, it should be pretty easy if you just look for outdated libraries which is dogwork for humans but very systematically approachable in some areas I think. This could for example be used in combination with the Log4jl REC exploit, where basically logging any user input in an outdated library is 'lethal'. What I also do know is that my friend actually tried InteliJ"s search to try to find a recent minecraft server crashing exploit. This exploit had been around for a few years in some, and is in the interest of some very hackerous communities. (shulker box dispenser world height exploit, 'hackerous communities' meaning 2b2t)
@dealloc
@dealloc 3 жыл бұрын
​@@gimmethedata4256 The issue is not so much to look up dependencies of libraries, that's easy. The hard part is finding the vulnerability in the original library or code where it originates. Any software the relies on code that has vulnerabilities will also inherit those vulnerabilities. But the severity depends on where and how it's used. So it doesn't mean that software that uses a library with vulnerabilities is itself vulnerable if the it's used in places that aren't exploitable. In the case of Log4Shell it is a severe vulnerability for any library and code that passes any user input, but not so much if it doesn't. This is sometimes a problem with automated systems as most of the results can be false positives, especially when scanning development-only environments. It adds a lot of noise and can hide the real threats that appear in code that interfaces with user and other external sources.
@gimmethedata4256
@gimmethedata4256 3 жыл бұрын
@@dealloc Yeah, but finding which things use the lib is already 20% of the most boring part of the work. I agree, it is rly hard to determine systematically whether or not something is an exploit, for therefore you first need to define what user input is. I agree that is really hard. Ig everything that goes through netty can be regarded as 'user input', but there I bet there are tons of ways to connect to netty so that is already a problem. Then you have also got libraries on top of the netty stuff ... then you need some algorithm to follow the stack trace of the user input and 'understand' a lot of internal functions, and how they change the user input. It is also kinda tricky to determine whether or not something is an exploit, I mean for RCE it should be pretty easy, but for teleportation exploits in game it is hard. But hey, even if you find 1% of the exploits systematically, then that is still an absolute win. I mean it is really 1% * times a thousand projects times 10 hidden exploits per project ... That's still a 100 exploits. So therefore I think you should focus on the easily systematically detectable exploits. Would you wanna collaborate on something like that? hobrin#4694
@cybroxde
@cybroxde 3 жыл бұрын
Billion Dollar Companies: Spending Millions on patching vulnerabilities Also Billion Dollar Companies: Shipping Frameworks that sideload code from a CDN and run it on your server without further checks just to save the developer 5 Minutes of thinking.
@cybroxde
@cybroxde 3 жыл бұрын
Addendum: I agree that in this case, the root cause is not the framework itself. However, it is a contributor to the issue and the CDN simply being compromised is another very possible and very unnecessary attack vector that using it adds to your application.
@FlorianWendelborn
@FlorianWendelborn 3 жыл бұрын
@@cybroxde Yeah, it looks quite insane to me to yolo-execute arbitrary code from a URL without verifying it via their public key with asymmetric cryptography. But AMP is evil anyways, so not too surprised they also added backdoors to servers that comply with them
@boris_js
@boris_js 3 жыл бұрын
Damn whenever i feel i know everything in js and then i see something like this which blows my mind..so many more things to learn
@AlienX-p2f
@AlienX-p2f Жыл бұрын
Gonna refer my buddies to learn OOP from this wholesome vid
@shintsu01
@shintsu01 2 жыл бұрын
Wow i am not a developer but a light bullb watching your video(s) with a mind blown effect. Thanks for the clear and understandable explanation why and how a exploit works. now i need to check my ops team if they actually manage exploits like these in general.
@codepro3380
@codepro3380 3 жыл бұрын
Your Logo is OP!! + the explanation ( Can you make react videos maybe in the future if you know ) ?
@elevatecyber5031
@elevatecyber5031 2 жыл бұрын
This is true black magic. Love it!
@iliedobre7703
@iliedobre7703 3 жыл бұрын
Thats why I name my variables Yoda style, instead of isAdmin I put AdminIs
@denial4260
@denial4260 2 жыл бұрын
yesAdmin = 'is';
@flexiorange3048
@flexiorange3048 3 жыл бұрын
Man this is gold. Thanks!
@Karan-um4bw
@Karan-um4bw 2 жыл бұрын
im here at 113k subs, and I'll be here for the 1 mil subs. great content ❤️
@newton4098
@newton4098 3 жыл бұрын
I llike the whole, "Eminem is a square" analogy.
@shashwathegamer
@shashwathegamer 3 жыл бұрын
You earned a sub ;) (and a disc member too :))
@0xdecaf
@0xdecaf 3 жыл бұрын
great video as usual
@mrala
@mrala 3 жыл бұрын
more prototype pollution please :)
@ej.xxxx_
@ej.xxxx_ 3 жыл бұрын
Welcome back!
@pxdav
@pxdav 3 жыл бұрын
Hey PwnFunction, just wanted to ask how do you make these videos. It looks really cool especially the drawing thing
@b43xoit
@b43xoit 2 жыл бұрын
The Self language pioneered objects without classes. Javascript continued that capability.
@boshbosho8181
@boshbosho8181 3 жыл бұрын
Pure gold, thank you!!!
@i_dont_want_a_handle
@i_dont_want_a_handle 3 жыл бұрын
"Everything in JavaScript is an object" - well no, not everything, forget that immediately
@vanjazed7021
@vanjazed7021 3 жыл бұрын
technically yes, just not the same type of object, but they all have common superclass
@i_dont_want_a_handle
@i_dont_want_a_handle 3 жыл бұрын
@@vanjazed7021 no, seriously. The fact that you can invoke methods on a string literal does not mean that strings are objects, it's merely a convenience mechanism. Strings are passed by value and their "typeof" is not object, so they really are primitive (just like numbers, bools, undefined and null)
@kuchingneko9616
@kuchingneko9616 3 жыл бұрын
glad your back
@dandogamer
@dandogamer 3 жыл бұрын
Learnt something new, nice vid
@warengonzaga
@warengonzaga 3 жыл бұрын
Thanks again @PwnFunction hahaha I'll create a list of your repos lol.
@mirrormirage0
@mirrormirage0 3 жыл бұрын
Awesome work!
@JoshPaulie
@JoshPaulie 3 жыл бұрын
Damn you!!! I swore I’d never learn js, but now I know how to make js classes 😭
@vintprox
@vintprox 3 жыл бұрын
Whoever though that flattening user input object into your codebase is alright, and that runContext is going to make better companion than eval? Yet another reason to switch over Sapper and other Svelte minimalistic solutions, in my opinion.
@frigga
@frigga 2 жыл бұрын
Stateful server side rendering is the root of all evil.
@Hope-kf1nl
@Hope-kf1nl 3 жыл бұрын
Do share a link to your IDE plugins. Digging the layout.
@PwnFunction
@PwnFunction 3 жыл бұрын
Check the description :)
@rishabkumar2187
@rishabkumar2187 3 жыл бұрын
bro i really love your content . especially the way you teach 🔥🔥🔥🔥😍😍😍😍💘💘
@jamesjones2212
@jamesjones2212 3 жыл бұрын
Awesome video as a life long hacker i am always amazed however much things change they stay the same.
@mmti1010
@mmti1010 3 жыл бұрын
12:20 👀👀 Don't to worry child, oh fu*k
@bas5rocker311
@bas5rocker311 3 жыл бұрын
great video man, what's your terminal configs btw
@kuroexmachina
@kuroexmachina 3 жыл бұрын
finally, something interesting popped up in my recommended
@yasserarguelles6117
@yasserarguelles6117 3 жыл бұрын
*Me in C programming procedural code, offline*: now this is safety
@kyputer
@kyputer 3 жыл бұрын
Well done 💪
@junfengou6856
@junfengou6856 3 жыл бұрын
This is awesome!
@henriquematias1986
@henriquematias1986 3 жыл бұрын
great video! what next.js version is this bug on? have you reported that to vercel?
@Wynell
@Wynell 3 жыл бұрын
Amazing video! BTW what's the font?
@Parrotassassin15TechToker
@Parrotassassin15TechToker 3 жыл бұрын
oop I am first lol that is cool loving your channel so far though!
@PwnFunction
@PwnFunction 3 жыл бұрын
Haha good eye. The video isn't supposed to be out this soon XD.
@Parrotassassin15TechToker
@Parrotassassin15TechToker 3 жыл бұрын
@@PwnFunction haha oops
@devhonk1722
@devhonk1722 3 жыл бұрын
gg
@du42bz
@du42bz 3 жыл бұрын
gg
@ianrhys
@ianrhys 3 жыл бұрын
node can be a nightmare if not done properly right. Keep an eye on package vulnerabilities or jump ship to stable backend scripts like php and python. Not saying they are secure but you have less to worry about.
@DKLHensen
@DKLHensen 3 жыл бұрын
Same kind of stuff happens in python and Php. Take a look at either language’ eval function. You should only ever use these kind of functions if you are 100% sure what you are doing is safe, but mostly this is mission impossible
@LUISANGEL27
@LUISANGEL27 3 жыл бұрын
I love tne way you explain
@astranger7995
@astranger7995 3 жыл бұрын
how did u make yor VScode look so good
@efeservili
@efeservili 2 жыл бұрын
Thank you for tNice tutorials! I've been trying to figure the software out on my own for a wNice tutorialle, and it's horribly confusing. TNice tutorials is the only guide video
@falxie_
@falxie_ 3 жыл бұрын
Oh god I gotta run snyk against my codebase now
@thetrends5670
@thetrends5670 3 жыл бұрын
Is it the channel of LiveOverflow's little brother?
@PwnFunction
@PwnFunction 3 жыл бұрын
how did you know 👀
@thetrends5670
@thetrends5670 3 жыл бұрын
@@PwnFunction you've been pwned
@jaywye
@jaywye 3 жыл бұрын
I like the penguin
@JLSynth
@JLSynth 2 жыл бұрын
Awesome!!
@gadgetvala
@gadgetvala 3 жыл бұрын
Nice explanation
@b43xoit
@b43xoit 2 жыл бұрын
I don't have familiarity with next.js and I guess readers who do have that understand where in your talk you refer to where a user could cause their arbitrary code to be executed on the server side, but for me, you blow through that very quickly and I don't understand or hear where you explain that. But I guess the bottom line of what you are saying here is that something about next.js or some common way to use it opens such a vulnerability.
@robinzon100
@robinzon100 2 жыл бұрын
did next or amp peps at least patch this? but I guess it's not next or amp vulnerability but the flatten modules
@evolutionxbox
@evolutionxbox 3 жыл бұрын
The rectangle class is an object
@biggietuna9843
@biggietuna9843 3 жыл бұрын
I polluted my pants
@lowborn7231
@lowborn7231 3 жыл бұрын
I know many people have already made videos abou it, but I really wanted to see youir video about Log4j vulnerability. I wanted to see your opinion as a security researcher, please, if you can, make a video about it.
@siddharthchhetry4218
@siddharthchhetry4218 3 жыл бұрын
One day i will understand this video fully :) Thank you for sharing such an awesome content .
@paxdriver
@paxdriver 2 жыл бұрын
Does this work even when dependencies are minified or do the object properties need to match the names in the objects exactly?
@Happy_Shaikh
@Happy_Shaikh 3 жыл бұрын
Which screen recorder do you use bro?
@Michaelmishael
@Michaelmishael 10 ай бұрын
thanks alot
@iamdanfleser
@iamdanfleser 3 жыл бұрын
what did you use to animate this video? edit software?
@scrambledmandible
@scrambledmandible 2 жыл бұрын
2:00 does this mean C structs can be classes
@b43xoit
@b43xoit 2 жыл бұрын
Before C++ was called C++, it was called "C with classes". The classes were a minor enhancement over structures.
@RedStone576
@RedStone576 3 жыл бұрын
waow finally a new video
@JorgetePanete
@JorgetePanete 3 жыл бұрын
3:40 i just put 2x speed and you say "eminem"
@Shortyxoli
@Shortyxoli 2 жыл бұрын
(proceeds to continue)
@FuzzyLitchi
@FuzzyLitchi 3 жыл бұрын
pretty cool!
@Aspiiire
@Aspiiire 3 жыл бұрын
Wow! this is a good video
@bigchum3984
@bigchum3984 3 жыл бұрын
are you able to access the base object because it was a global variable? would namespacing protect against this?
@ZoranRavic
@ZoranRavic 2 жыл бұрын
The base "Object" is always global.
@Bogdan-ef9wz
@Bogdan-ef9wz 3 жыл бұрын
Thank you
@IShowD
@IShowD 3 жыл бұрын
what is the whiteboard software u using ?
@wowbean
@wowbean 3 жыл бұрын
No idea what’s happening but I like it.
@Elenthiriel
@Elenthiriel 2 жыл бұрын
Please , teach us how to understand and debug code like you
@jlacr8056
@jlacr8056 3 жыл бұрын
can we do a video where you don’t explain the entirety of OOP beforehand
@zxuiji
@zxuiji 3 жыл бұрын
off topic but it's a thing I learned today, in css you can honour text dpi by simply using the "in" unit on :root font-size then use rem everywhere else
@daleryanaldover6545
@daleryanaldover6545 3 жыл бұрын
nc
@m3mphi5r4r7
@m3mphi5r4r7 3 жыл бұрын
Just wow 🤩
@DanielM2001
@DanielM2001 3 жыл бұрын
Don't you worry, don't you worry child :)
@TheJoaogouveia
@TheJoaogouveia 3 жыл бұрын
I'm a bit confused about how the getServerProps is actually exploited, in the example, it's not even receiving data from the url query, also, even if it was, the only prop being returned is the one we actually want, can someone kindly point out which part of the process am I missing?
@bussin1337
@bussin1337 3 жыл бұрын
I'm guessing the unflatten function itself does something to the input that overrides the global Object's __prototype__. Don't even need to return the value
@ZakiWasik
@ZakiWasik 3 жыл бұрын
I tried your repo. After polluting the prototype like you do at 10:54 I get the 404 but if I try to go to localhost:3000 I still get 404 so I guess the global namespace did not get polluted in my case?
@0xfolling
@0xfolling 3 жыл бұрын
I really appreciate your explanations and know this is subjective: But personally I would prefer if you assumed some basic knowledge about a subject and then explain the topic you want rather than explaining everything from the ground up. The explanation for classes, objects, and members felt a little bit underwhelming for the video at hand. That being said, your explanation there was, as always, wonderful, along with the rest of the video!
@PwnFunction
@PwnFunction 3 жыл бұрын
Thanks! I'll apply that next time. A bunch of people also told me the same thing. I appreciate the feedback.
@user-sn6yb8kr1m
@user-sn6yb8kr1m 3 жыл бұрын
@@PwnFunction I really appreciated and enjoyed how it was broken down and explained. Subscribed and liked as well!
@fastexpand
@fastexpand 3 жыл бұрын
Consider putting in timestamps so people who already know it can skip ahead easily and beginners can still watch the basic stuff
@animeguywithexistentialcri5084
@animeguywithexistentialcri5084 3 жыл бұрын
@@PwnFunction btw what colorscheme you're using in vscode in this video, sir? mine is the default and not really that colorful...
@pala9983
@pala9983 3 жыл бұрын
HTML Injection explained pls!!
@philippelhaus
@philippelhaus 3 жыл бұрын
Interesting 👍
@_Funtime60
@_Funtime60 3 жыл бұрын
It seems REALLY dumb that JS lets you add things to objects that aren't in the class and add things to both ON THE FLY. I can see uses for this, but none of them need this feature and it adds looks to add so many risks.
@blakek13
@blakek13 2 жыл бұрын
This was heavily used for something called polyfills. Basically, if the browser doesn’t support a JS feature (or its implementation is buggy) you can conditionally add it to the language yourself. It’s used a lot less in modern code supporting modern clients. It’s also pretty useless for business logic. It was great for JavaScript because the number of runtimes that many projects supported. This would be a lot less useful in a compiled language because you know the compiler you’re targeting and the features it supports.
Dangerous Code Hidden in Plain Sight for 12 years
18:00
PwnFunction
Рет қаралды 1,6 МЛН
This Website has No Code, or Does it?
10:08
PwnFunction
Рет қаралды 1,1 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Make Money from your API Tutorial
13:10
Fireship
Рет қаралды 888 М.
How To Predict Random Numbers Generated By Computers
13:54
PwnFunction
Рет қаралды 568 М.
Server-Side Template Injections Explained
9:54
PwnFunction
Рет қаралды 92 М.
Why you should Close Your Files | bin 0x02
8:11
PwnFunction
Рет қаралды 321 М.
HTTP Parameter Pollution Explained
11:08
PwnFunction
Рет қаралды 256 М.
How some functions can be Dangerous | bin 0x01
15:20
PwnFunction
Рет қаралды 141 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 227 М.
XML External Entities (XXE) Explained
20:11
PwnFunction
Рет қаралды 162 М.
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН