XSS Explained - What Is Cross Site Scripting - Build Expense Tracker App With PHP 8

  Рет қаралды 6,198

Program With Gio

Program With Gio

Күн бұрын

Пікірлер
@Armando-px8hi
@Armando-px8hi Жыл бұрын
Great Lesson, very useful for me, I am a student for cybersecurity and this was more than kust a lesson for me.Thank you Gio for covering this topics.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Glad it was helpful, thank you
@hansschuijff
@hansschuijff 2 жыл бұрын
Clear explanation and mostly a reminder with examples to properly escape output. Thanks for the lesson and the great OWASP resource.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
You're welcome & thank you 🙌
@omaryahia
@omaryahia 10 ай бұрын
you are amazing man🙂never fail to amaze me thank you Gio for these amazing excellent lessons
@ProgramWithGio
@ProgramWithGio 10 ай бұрын
Thank you
@ismaelkhangane513
@ismaelkhangane513 2 жыл бұрын
It's really helpful to my self-learning! Thank you a lot
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Happy to hear, you're welcome 🙌
@RicardoVargasM
@RicardoVargasM 11 ай бұрын
Amazing video, congrats.
@ProgramWithGio
@ProgramWithGio 11 ай бұрын
Thanks a lot!
@Zubbee
@Zubbee 2 жыл бұрын
Great work Gio. I'll dig in
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you
@behnooshmoshtagh382
@behnooshmoshtagh382 2 жыл бұрын
Thank you Gio!
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
You're welcome 💙
@lautarolopez5372
@lautarolopez5372 2 жыл бұрын
Great tutorials Gio!! Keep going!
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you 🙌
@levani7851
@levani7851 2 жыл бұрын
Fantastic as always
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thanks 🙏
@Zubbee
@Zubbee 2 жыл бұрын
Thank you so much Gio for this lesson. Always wondered how some of these things were done. I'll do my best to do the OSWAP reading you highly recommended for us. I have a question I didn't in the earlier lessons. is it usually typical to first build components of an application and then refactor? or do ppl try to build the application with best code layout(not sure what word to use) so that you don't necessarily need to refactor again afterwards. in order words, should I aim at writing beautiful code from the get go? Or is is a usual Devs practice to write functional code first and then earmark another time for refactoring? Thanks again Gio
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
It's ok to write ugly code first & then refactor. My usual goal is to get it working regardless of how code looks. Then if it looks ugly I refactor it. Sometimes it doesn't look ugly, sometimes it does. That being said, I don't take too long to refactor because then it will never be done and you would just be building on more tech debt. I refactor it mostly on the same day, so I write & get it to work first & then right away refactor it.
@Zubbee
@Zubbee 2 жыл бұрын
@@ProgramWithGio Okay great Gio. The way you described it being done in the same day makes a lot of sense. And then not accumulating tech debt (I like that phrase lol.) Seems like a pretty good idea.
@asmadev8812
@asmadev8812 2 жыл бұрын
hi Gio, thank you for this wonderful content, can you share with us a stream course ?
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Hello, what do you mean by a "stream course"?
@ნოდარდავითულიანი
@ნოდარდავითულიანი 2 жыл бұрын
You guys should know that Gio is from Georgia🇬🇪🇬🇪🇬🇪
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
😁 🇬🇪🇬🇪
@muhammadafnan_8819
@muhammadafnan_8819 2 жыл бұрын
Sir plz make video on PHP PDO complete e-commerce project
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thanks for the suggestion 🙌
@guy4722
@guy4722 2 жыл бұрын
WOОORKING!!!! OMG!!!
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Nice
@benderbg
@benderbg 2 ай бұрын
Escape before job escapes you 🤣
@ProgramWithGio
@ProgramWithGio 2 ай бұрын
Good way to look at it 😄
@Octavus5
@Octavus5 2 жыл бұрын
Sanitize fields that need to be sanitized before saving into your DB. Sanitize fields that need to be sanitized when retrieving data from your DB. (This can be automated easily) Then the data you work with at the html level is always as it should be and there are no unexpected dangers. I don't think that you should ever leave it up to the HTML person to sanitize data. They should only think about displaying data. Personally, I don't understand the brouhaha about XSS. It's a simple problem to fix and every programmer should know how to do it without relying on 3rd party libraries. Or am I missing something here?
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Generally I agree but you should save data in database table as is, as I stated in video it can cause bad user experience if you start converting HTML entities on save or removing HTML elements, a long text entered by user in a note field can contain special characters that are not harmful but you sanitizing and removing or converting them will hurt the UX when displaying that data not to even mention double escape. So rule of thumb is escape on output and HTML person or the one working on front-end should know that, and in backend you sanitize what you need but try to save the original text as is in the database table. Maybe you misunderstood, I don't mean to pass raw text in queries, of course you would still use prepared statements which protects you from SQL injection, I mean saving text safely in the database in it's raw form.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Also not sure what you mean by 3rd party libraries? We are not using any third party library, we are using Twig templating engine which is jus that a templating engine and provides protection. Even if you use plain PHP templates you still need to escape it manually otherwise you are vulnerable to XSS whether you sanitize data in backend on save or not.
@Octavus5
@Octavus5 2 жыл бұрын
@@ProgramWithGio Hey Gio, really like your series. I don't disagree with really anything you've said. As I stated, sanitize what you NEED to sanitize, ie, what you ShOULD sanitize BEFORE it goes into the DB and when you RETRIEVE it from the DB. As the developer, you should know what they are; what fields; what sorts of data. Obviously, if you have comments data that allows for html, you don't want to completely sanitize that. You may want to allow for some css styling, but remove script tags. On the other hand, I think it's bad practice to let the HTML guy work with dangerous data and give him the power/opportunity to make bad mistakes. Anything that should be sanitized should already be sanitized before he gets his hands on it at the presentation/html level, in my view. Whatever data he works with should be harmless and innocuous and pre-sanitized. Twig is not native to PHP, so it is a kind of 3rd party library? External templating engines may be a good choice, but ultimately, optional. Personally, it doesn't seem to be a good idea to rely on templating engines to protect you against XSS attacks. All data should already be sanitized by the time it is handed over to the presentation layer. Enjoy your videos, Gio!
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
@@Octavus5 yea for sure, sanitize what you need to sanitize but I think you are misunderstanding something. Twig has nothing to do here, even if it's regular PHP you have to escape all output regardless if it's safe or not. Same way frontend can't rely on backend to have everything sanitized. All output should always be escaped on display, regular PHP that's done via htmlspecialchars function, in js context it's done via json_encode and so on. XSS is very dangerous and can't be taken lightly, it's not something only backend can take care of, person working on front-end should be well aware of what XSS is and how to properly escape it. Data may not be coming from database, it may be coming from API in which case you can't guarantee it to be "safe" and sanitized, so it should always be escaped. Templating engines just make it easier, we just happen to be using Twig in this series, if we weren't then we would be using htmlspecialchars to escape on display. I almost never apply htmlspecialchars on backend on save because that is worse in many cases where it opens up for double escape problems. Thank you btw 💙💙
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Maybe the confusion is with wording "sanitize" vs "escape". Sanitize/filter input before going to database I agree, but escape on output. Here is one article where you can read more about it, I do disagree with couple of his points but is still worth a read: benhoyt.com/writings/dont-sanitize-do-escape/ And discussion on Reddit if you want to see what others think about it: www.reddit.com/r/PHP/comments/s32zcu/dont_try_to_sanitize_input_escape_output/hsifnhk?context=3
@FGj-xj7rd
@FGj-xj7rd 2 жыл бұрын
Lmao. The thumbnail.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
😂
Cross-Site Scripting (XSS) Explained! // How to Bug Bounty
14:43
Как Ходили родители в ШКОЛУ!
0:49
Family Box
Рет қаралды 2,3 МЛН
8 Rules For Learning to Code in 2025...and should you?
12:59
Travis Media
Рет қаралды 98 М.
9 small, unproductive programs
7:43
The Exhausted Programmer
Рет қаралды 2,2 М.
XSS - Cross Site Scripting Explained
7:24
Virtual Forge an Onapsis Company
Рет қаралды 232 М.
Cross Site Scripting (XSS) tutorial for Beginners
11:37
Loi Liang Yang
Рет қаралды 104 М.
Cross Site Scripting XSS  Explained | TryHackMe Junior Penetration Tester | OSCP
26:38
Motasem Hamdan | Cyber Security & Tech
Рет қаралды 28 М.
Create a malware keylogger with JavaScript cross site scripting XSS attack
22:57
Programming w/ Professor Sluiter
Рет қаралды 3 М.