Тёмный

Laravel Security: Top 7 Mistakes Developers Make 

Laravel Daily
Подписаться 145 тыс.
Просмотров 85 тыс.
50% 1

Опубликовано:

 

2 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 145   
@ward7576
@ward7576 2 года назад
You sure deserve a RU-vid play button. Your content seems to be coming out right when I need something specific like you release, ha
@G5STU
@G5STU 2 года назад
As someone that’s been using Laravel since v4.2, I love your content , straight to the point, no dithering , no BS - I hope you get your silver platter soon :)
@exintrovert1337
@exintrovert1337 9 месяцев назад
Subscribed. Get that play button! You deserve it. Straightforward, clear, no fluff… I love your style.
@rosselliot8971
@rosselliot8971 2 года назад
Pov, this is good stuff. Can I suggest you do more videos with the theme of "common mistakes". Security is the obvious topic but there are many others where developers do things that while they do not expose security issues nevertheless create problems for the user experience and app stability. This is a serious thing and would increase views to your channel. Thanks for your hard work and I hope you hit 100K subs soon.
@LaravelDaily
@LaravelDaily 2 года назад
Thanks for the idea. I am actually doing more videos like this, just maybe never calling it specifically "common mistakes". Maybe need to make rebranding of the titles :)
@EdgarsVanags
@EdgarsVanags Год назад
​@@LaravelDailyns S L 😊😂😮😢 Yo4
@paulfontaine7819
@paulfontaine7819 2 года назад
When using livewire: if you have a model or collection of models defined as public class variable, their attributes are sent to the client and visible with a simple view source as are all the public variables.
@SinghatehAlagie
@SinghatehAlagie 2 года назад
Surely you will reach there soon sir, we always behind you and we will keep supporting to reach your goals. Thank you for the valuable contents.
@khakimovnodir
@khakimovnodir 2 года назад
I really appreciate your every single video. They are so helpful to me.
@hollyhayes110
@hollyhayes110 2 года назад
Best wishes for getting that silver button soon! You deserve it. I can’t imagine putting out a video *daily*, and such quality content, and well-delivered, too. Your “hello guys” at the beginning is so friendly & familiar - love it. :)
@eternalsoma
@eternalsoma 2 года назад
I had the ugly experience of patch a php application that had the 5.x version, no framework and legacy code. it had no validation, no token, no escape variables and most important 0 documentation. It was a nightmare to patch up and migrate to php 8. Everything while the APP was under heavy attack from bad guys
@KaydotOrigin
@KaydotOrigin 2 года назад
Another: People using Raw DB queries and not binding parameters subsequently leading to an SQLi.
@paulfontaine7819
@paulfontaine7819 2 года назад
If you can't "Imagine what could go wrong if any person could inject any javascript on your page.", think of a javascript initiated POST request changing data on the server using your credentials as it is you that sees the page in your browser.
@daleryanaldover6545
@daleryanaldover6545 2 года назад
Just wanted to add, never put sensitive data in cookies. An experienced attacker will thank you for leaking out information using cookies.
@vaibhavhalcyon
@vaibhavhalcyon 2 года назад
gr8 video ,which i listen till date..
@tr4shcoookieees
@tr4shcoookieees 10 месяцев назад
I also want to tell my story. When I first started learning things like TypeScript, I didn’t quite understand how I could make a POST request to the server and pass the CSRF token from the TS file. For this reason, I (I still don’t understand why) made these requests through the api.php file. A little later I found out that requests that are processed in api.php are not protected against csrf attacks. This mechanism works in web.php, while api requests do not require any tokens to run controller methods. To be honest, I still don’t quite understand how I can correctly make such requests if they come from a .ts file. If anyone knows more about this, could you tell me what solutions there are?
@wildfireDZ
@wildfireDZ 2 года назад
One common mistake I see people doing, is not protecting the {id} in routes. Which means a user can affect data of another user
@konigkoudogbo660
@konigkoudogbo660 2 года назад
No, if you make validation in the backend
@kennedygitahi
@kennedygitahi 7 месяцев назад
What if you use UUID for the ID so that it is not sequential?
@morteza55510
@morteza55510 Месяц назад
That's why we have authorization And you can also use route model binding {user}
@lovietech3885
@lovietech3885 2 года назад
all() is one of my bad. Thank you so much for this tips. I will correct myself
@djnkuli
@djnkuli 2 года назад
If there's anyone who deserves 100K + subscribers and that youtube sliver play button, its got to be you brother man
@MapleLeafYT
@MapleLeafYT 2 года назад
Need to know more about file upload security
@ngocatnguyen5771
@ngocatnguyen5771 2 года назад
I have to clean up one project before. Using CORS * on production, doesn't turn off app debug, render directly the db column name to table instead of using alias, only validation on the client size. It took me only 10 seconds to figure it out how to break into the database.
@FindWebX
@FindWebX 2 года назад
Thanks a lot for sharing knowledge with us
@LaravelDaily
@LaravelDaily 2 года назад
Want more similar lessons? My Laravel courses membership: laraveldaily.com/courses
@SXsoft99
@SXsoft99 Год назад
is Java secured? I am going to leave a general answer "If the developer is bad at coding and doesn't care about securing their application NO", but then again there is a job market for people that are paid to look at the code and yell at those developers that they should not hardcode security keys inside the client app (for example: 2 years ago I was listening to a podcast of a lady that said she found hardcoded security keys inside android banking applications, with comments in the code "stop putting security keys in the code") So to sum it up, most of the time the problem is between the chair and the screen
@ghazyy1
@ghazyy1 2 года назад
i wonder if you can make the same video for developers who use laravel just for API as a backend and tell us about security concerns we may face
@networkerbowofade8477
@networkerbowofade8477 2 года назад
pls I am used to csrf but with the invention of livewire, is it necessary again because I dint even bother to include it because you can submit form without even form elements using livewire.
@LaravelDaily
@LaravelDaily 2 года назад
In Livewire csrf isn't needed, Livewire takes care of that, internally.
@networkerbowofade8477
@networkerbowofade8477 2 года назад
@@LaravelDaily thanks for the clarification
@raghavendrajangam3923
@raghavendrajangam3923 9 месяцев назад
Hi Sir please make one video on how to prevent unauthorized user to access of our code directly mainly from server side. For Example. How to secure server for Laravel projects as well as what are the loopholes how to prevent them etc.
@parumhr1268
@parumhr1268 3 месяца назад
Can you make a video about Content Security Policy (CSP) in livewire or laravel in general.
@hanymax
@hanymax 2 года назад
Thanks Sir you helping so much .... i really appreciate it
@mangtri9680
@mangtri9680 2 года назад
Nice info sir, thanks!
@emekatimothyiloba699
@emekatimothyiloba699 2 года назад
YOU WIll surely go beyond 200K subscribers Sir, you are really doing a great job. Thanks and God bless
@nabeelyousafpasha
@nabeelyousafpasha 2 года назад
Respect from Pakistan 🇵🇰 Rate Limiting is left from my side, all other stuff is my daily routine.
@johnnyokito6356
@johnnyokito6356 6 месяцев назад
Great video!
@icantchosemyname
@icantchosemyname 2 года назад
I didn't know about rate limiting feature, thank you a lot. I've just shared your video
@ayenewyihune
@ayenewyihune Год назад
Very informative
@NotBeHaris
@NotBeHaris 2 года назад
Awesome topic sir.
@aphelioschenik3162
@aphelioschenik3162 2 года назад
never played a full tutorial video without x2 speed outside work. very good video i subed
@mohsen-n9j
@mohsen-n9j 8 месяцев назад
I forgot to say that the Laravel 10 I am using
@DarylLegion
@DarylLegion 2 года назад
Thanks. very informative, while watching I thought of .. what if there's a video version (course?) of the Laravel documentation, that's too much though 😅
@LaravelDaily
@LaravelDaily 2 года назад
Would you watch all those 23 hours? :) www.omnicalculator.com/everyday-life/reading-time?c=EUR&v=reading_speed_descrip:0.5,pages_read:700
@soniablanche5672
@soniablanche5672 2 года назад
There is a case that isn't handled by laravel blade: the href property of the "a" tag. the href value could be equal to something like javascript:alert(1). If the href value comes from users you don't trust you have to make sure it doesn't start with "javascript:" or you could make sure it has a valid URL format
@guccilive100
@guccilive100 2 года назад
That’s a good idea Sonia. But how will you check that?
@soniablanche5672
@soniablanche5672 2 года назад
@@guccilive100 Laravel validation has a "url" validation rule, you can use that to force href values to only be valid urls
@felipe-e6t
@felipe-e6t 2 года назад
Last week analyzing my apache log I found some requests to /.env, so make sure that your .env file is not public, you never will be 100% safe, so do your best
@artificallead499
@artificallead499 2 года назад
where do you find the .env in production i can never find mine myself i see it in testing but it seems to disappear during live server upload
@opeyemiilesanmi2059
@opeyemiilesanmi2059 2 года назад
@@artificallead499 You may not see it on your repo if you hide it in .gitignore but on your live server it will be there
@chiraghvyas3462
@chiraghvyas3462 2 года назад
Thank you for this great stuff. I'll more thankful if you also create video of how to overcome this issues specially file access or .env access from shared hosting or public folders.
@LaravelDaily
@LaravelDaily 2 года назад
I don't work with shared hosting (and I don't recommend anyone else doing it), so I can't make a video on it.
@sherzod_kudratov
@sherzod_kudratov Год назад
First of all, big thanks, what about xml attack? And sql injections? Have any vulnerability for sql injections in laravel? If yes, how can it be safer?
@rejowanahmed6819
@rejowanahmed6819 Год назад
Why are you so good? 💚💚💚
@MAAZKHAN-xv1lc
@MAAZKHAN-xv1lc Год назад
You are just awesome
@yungifez
@yungifez 2 года назад
But I feel like request except is also a security loophole
@LaravelDaily
@LaravelDaily 2 года назад
Yes if you don't provide the dangerous properties in except
@yungifez
@yungifez 2 года назад
@@LaravelDaily which in most cases is all other fields in dB
@msdeav
@msdeav 2 года назад
thank you...
@eloquent2200
@eloquent2200 2 года назад
Thank you!
@LoganathanNatarajanlogudotcom
@LoganathanNatarajanlogudotcom 2 года назад
Thank you!
@kiumarsbabolhavaeji7982
@kiumarsbabolhavaeji7982 2 года назад
thank you
@Rapid-eraser
@Rapid-eraser 2 года назад
Rate limit is a good option to negotiate delayed payments :P
@jelajahmania
@jelajahmania 2 года назад
excuse me sir, how to install laravel vue js with tailwind css .. same as using npm?
@mohdanas8027
@mohdanas8027 2 года назад
Great
@pabloescobarparis6586
@pabloescobarparis6586 2 года назад
Well done Povi ! May I ask if you can do a video on how to approach a php/laravel upgrade task. So for example, upgrading from laravel 8 to 9, and what steps you would take.
@LaravelDaily
@LaravelDaily 2 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mPBkYdrOEdQ.html this is my video on a similar topic. Also I recommend laravelshift.com
@pabloescobarparis6586
@pabloescobarparis6586 2 года назад
@@LaravelDaily Oh awesome you already have this covered. Nice 👌
@timoteobega
@timoteobega Год назад
👋👋
@AMoktar
@AMoktar 2 года назад
Thanks bro
@sawcenmaamri1889
@sawcenmaamri1889 Год назад
About what you said at 11:15 ("do not use get requests for anything that should be changing the data" ) : we can use a middleware (like "authenticate" or any custom middleware to authorise the get route call.
@kyjovs7746
@kyjovs7746 2 года назад
How to perform vulnerability assessment?
@hermawansafrin8602
@hermawansafrin8602 2 года назад
Thank you sir, i think your videos is very usefull. Thanks for your dedication.
@abdulllahbutt5119
@abdulllahbutt5119 2 года назад
great info.
@hassanfazeel2354
@hassanfazeel2354 2 года назад
This is sooo goood..awesome work! this channel deserve a "varified tick". thanks a lot.
@aachan13
@aachan13 2 года назад
nice video! are there any chance you make a video about microservice with laravel?
@LaravelDaily
@LaravelDaily 2 года назад
I haven't used microservices in Laravel so can't make a video about it
@aachan13
@aachan13 2 года назад
@@LaravelDaily ok thanks
@Landrynadre
@Landrynadre 2 года назад
Hello! Maybe you recording video on laravel Policy? How block any action in another user when user is not the same Group. Or how user can get only our post when he post another id in request. I have problem with this and no were information how do this. I have two model Clients and Users, Clientis Group amd have more users. Now when i send GET REQUEST id another client i can get users another client.
@LaravelDaily
@LaravelDaily 2 года назад
I don't have a video specifically for your situation, but I have a general one: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-kZOgH3-0Bko.html
@muhammedrafia8881
@muhammedrafia8881 2 года назад
Hi povilaz....can you make one video about laravel project hosting in shared server, it's very helpful to all Thanks in advance.
@LaravelDaily
@LaravelDaily 2 года назад
I don't use shared hosting and don't recommend it to anyone.
@kevinsada7840
@kevinsada7840 2 года назад
Hello Povilas, Great video! Just 1 question regarding the first example. What about the cases I have a WYSIWYG in my blog post and the user can enter a html? I am forced to escape it. what's the solution?
@kevinsada7840
@kevinsada7840 2 года назад
@laravel daily
@bboydarknesz
@bboydarknesz 2 года назад
thank you. please make this video more advanced. maybe for example, case someome is attacking you by register 2 user every minutes with valid otp (this crazy but it reals dont know how they have random phone number otp), then you block its IP but he changes his IP and last you use recaptcha to prevent the attack.
@LaravelDaily
@LaravelDaily 2 года назад
I don't want to get deeper into hacking topic, that's not my topic or my strong skill.
@emekatimothyiloba699
@emekatimothyiloba699 2 года назад
Wow this is very insightful sir. Thanks for sharing
@infosond
@infosond 2 года назад
7 Mistakes beginners devs make :)
@elmarzougui
@elmarzougui 2 года назад
amazing stuff thank you Povilas
@GergelyCsermely
@GergelyCsermely 2 года назад
Thanks
@عبدالعزيزالمخلافي-ص4ج
I always enjoy your content ♥️.
@adesanoyesamson668
@adesanoyesamson668 2 года назад
Amazing mentions. Thank you
@waseemAlhabash
@waseemAlhabash 2 года назад
Does using Eloquent and Query builder safe enough to prevent SQL injection ?
@LaravelDaily
@LaravelDaily 2 года назад
Yes
@0x0456
@0x0456 Год назад
Great video as always, would love to see more of these!
@phoenixedge4049
@phoenixedge4049 2 года назад
Good stuff. Would you ever consider doing a course on security in Laravel, PHP, and Livewire, or even just more videos on it? It's a huge concern that I feel like doesn't get enough attention, and even as a mid-level developer and working with Laravel over 5 years, I'm not always sure how to be sure my code is 100% secure other than avoiding some of the obvious like you point out in this video. Like a good example of content you could cover is how supposedly we should be using UUIDs for our models, but it's not always clear the best way to do that or when to do that
@LaravelDaily
@LaravelDaily 2 года назад
Well, I've covered the main things in this video, so not sure what I would say in a course. For UUIDs, I have that covered in other courses, like here: laraveldaily.teachable.com/courses/how-to-structure-database-in-laravel/lectures/31520548
@robwolters7401
@robwolters7401 2 года назад
I am using json in a crud app. Still a bit unsure about possible vulnerabilities. Do you have any information?
@LaravelDaily
@LaravelDaily 2 года назад
I don't like or personally use json so can't advise really
@robwolters7401
@robwolters7401 2 года назад
@@LaravelDaily What's not to like? Thanks anyway.
@LaravelDaily
@LaravelDaily 2 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9uhXI4nDpOQ.html my video about it
@robwolters7401
@robwolters7401 2 года назад
@@LaravelDaily I didn't know all those json queries, so not using that. Putting id's in json should slow thing down, wouldn't do that. My question is more about decoding json in api calls, and the associated security problems.
@LaravelDaily
@LaravelDaily 2 года назад
Oh THAT json. Then the main thing is to validate the data from that json, for whatever malicious things you may find there.
@chlouis-girardot
@chlouis-girardot 2 года назад
You are legit ! Definitly !
@alessandrofuda965
@alessandrofuda965 2 года назад
very very top! :)
@ricko13
@ricko13 2 года назад
awesome 👍
@fdelval2
@fdelval2 2 года назад
* runs to double check all of my Code *
@magmaticly
@magmaticly 2 года назад
Is it a mistake to add data in a migration, or should migrations only change the database structure? For example, we keep our translations in a database table. If we need another word translated, should we add this in a migration? Or should we use a seeder? Or something else?
@albert_vds
@albert_vds 2 года назад
Every database structure and data that makes the application usable from the start should go in migrations. Seeders are for testing or even demo purposes.
@LaravelDaily
@LaravelDaily 2 года назад
Totally fine in migrations
@МиткоЖечев
@МиткоЖечев 2 года назад
What do we do when we use wyswyg form editor and finally we have to show unescaped data?
@ChrisT-ib1zh
@ChrisT-ib1zh 2 года назад
Validate the content first for accepted tags. Disable script tags etc
@pauliuxxx141
@pauliuxxx141 2 года назад
Hello, Povilas I have a question. Lets say there is a blog post site and user can make a post that contains all those html tags like link, table and so on, how the content should be displayed if {!! $content !!} is a security issue? Should developer write a some code that checks if there are strings like or
@LaravelDaily
@LaravelDaily 2 года назад
Yes you should enable only certain tags. I'm planning to shoot a video about it, some time later in 2022.
@weiwendeng7486
@weiwendeng7486 2 года назад
I think in this situation, always wrap the content with PHP htmlspecialchars() function before saving it to the database. By doing so it will convert all the tags to special characters. Now when showing, you can use the {!! $content !!} and you will be fine. Even if a user pass a malicious script, it will not execute
@programmeryk5659
@programmeryk5659 Год назад
please make one about file upload exploit
@alaaalssadh2362
@alaaalssadh2362 2 года назад
Thank you so much sir
@syedshariqueahmed9039
@syedshariqueahmed9039 2 года назад
Thanks for the info sir
@p30mehrdad
@p30mehrdad 2 года назад
WooooW, thank you.
@eliabekun
@eliabekun 2 года назад
Show!
@santorehman8960
@santorehman8960 2 года назад
What's the best secured way to upload laravel project in shared hosting?
@LaravelDaily
@LaravelDaily 2 года назад
I don't use shared hosting and don't recommend it to anyone
@opeyemiilesanmi2059
@opeyemiilesanmi2059 2 года назад
I won't recommend it too. You have to change the root folder directory and change the app boot directory. I don't like the hack. it's not easily maintainable
@mdasifiqbal8912
@mdasifiqbal8912 2 года назад
Thank you so much for your video. Please make a video on passing {id} value in route. We are using direct id which is the primary key for the Post, Put method and Laravel also use the same in resource controller. Please make a video with this topic and security issues.
@LaravelDaily
@LaravelDaily 2 года назад
Already scheduled for the next week
@mdasifiqbal8912
@mdasifiqbal8912 2 года назад
@@LaravelDaily Thanks a lot
@opeyemiilesanmi2059
@opeyemiilesanmi2059 2 года назад
@@LaravelDaily Have you done this? if yes, please where's the link?
@sahirkhan5304
@sahirkhan5304 Год назад
love from pakistan
@bumblebity2902
@bumblebity2902 2 года назад
How store data written by text editors, safely?
@ChrisT-ib1zh
@ChrisT-ib1zh 2 года назад
strip script tags.
@yasark6347
@yasark6347 2 года назад
How to upload a image via mobile camera in website from mobile browser using laravel livewire ? I have tried by adding attribute capture in file input and opened a site in mobile browser and trying to upload it shows file manager and camera option i selected the camera and taken the image and upload livewire showing failed to upload image
@LaravelDaily
@LaravelDaily 2 года назад
Sorry it's impossible to blindly debug your situation in a RU-vid comment
@yasark6347
@yasark6347 2 года назад
@@LaravelDaily thanks for your reply . Is there a way to upload a image from mobile camera from website using laravel livewire. ?
@PovilasKorop
@PovilasKorop 2 года назад
@@yasark6347 I don't think Livewire is different from Laravel, it's the back-end framework, the question is what tools you use on the front-end for the upload - a simple input or something more complex. Again, hard to answer in a comment. But yes, it's possible, mobile browser is still a browser.
@yasark6347
@yasark6347 2 года назад
@@PovilasKorop thanks to you
@linasgutauskas5528
@linasgutauskas5528 2 года назад
We disable @csrf on sale forms. Customer might leave browser open for the whole day and only then can submit the form. I know, that there is some javascript packages, which updates csrf codes, but that doesn't gurantee in 100% and we do not want to lose a sale. (not perfect from security side, but sales are more important)
@ChrisT-ib1zh
@ChrisT-ib1zh 2 года назад
Better to extend the lifetime of the csrf token. m
@artificallead499
@artificallead499 2 года назад
@@ChrisT-ib1zh good point
@jayjolupoi88891
@jayjolupoi88891 2 года назад
noice
@EdgarsVanags
@EdgarsVanags Год назад
S
@kirayamato6128
@kirayamato6128 2 года назад
Me who use REST API'S: 🤷
Далее
Китайка стучится Домой😂😆
00:18
You don't need a frontend framework
15:45
Просмотров 127 тыс.
Top 5 Laravel "Bad Practices" (My Opinion)
10:32
Просмотров 22 тыс.
9 Tips for Shorter Laravel Code
10:16
Просмотров 61 тыс.
Laravel's secret weapon: macros (watch me code)
23:46
Laravel Code Review: Why NOT Use Repository Pattern?
14:21
I'm new to testing in Laravel (Watch me learn)
22:03
Difference between cookies, session and tokens
11:53
Просмотров 635 тыс.
Faster Eloquent: Avoid Accessors with Foreach
9:35
Просмотров 53 тыс.
Китайка стучится Домой😂😆
00:18