LocalStorage was a mistake...

LocalStorage was a mistake...

Josh tried coding

4 месяца назад

44,651 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@genechristiansomoza4931
@genechristiansomoza4931 - 08.01.2024 00:58

You did not demonstrate an actual attack. All things you show is just "imagine" and an "if" scenario that did not happen at all

Ответить
@JakeAndDaddy
@JakeAndDaddy - 08.01.2024 01:12

This isn’t great I’m afraid. Security is a bit more involved than this.
JWT is where you should be storing secure information. Only enough o authenticate and look up values on server side.
The JS only needs to know enough to pass in headers and cookies

Ответить
@Akshatgiri
@Akshatgiri - 08.01.2024 01:23

Also worth mentioning that chrome extensions can inject javascript to the website. So even if your website is not vulnerable to xss attacks, chrome extensions can still take advantage of local storage.

Ответить
@brunocabral88
@brunocabral88 - 08.01.2024 01:35

Nice video, albeit a bit mistitled.. LocalStorage was not a mistake, it is just that people (myself included) started using it as a wrong tool for resolving the challenges we had at hand

Ответить
@maratmkhitaryan9723
@maratmkhitaryan9723 - 08.01.2024 02:06

That is bullshit, literally impossible to get XSS if you do not use dangerous methods. Also, if attacker can execute JS already it is not a big deal that he can steal the token, he already can programmatically do any action with user's account. He does not need the token do actually do that, he can just directly use fetch from the user's browser.

Also, there are many preventive methods that must be involved like CSP that avoid any leaks to attacker's C2.

Ответить
@azusagawa
@azusagawa - 08.01.2024 02:45

Nice video, but i have a question. When using a express backend that is sending the JWT access and refresh token, and we store them inside next-auth jwt token, when we load a page with getSession and serving to user the session with the two tokens, we are getting the same problem as the video presented right? Because The main question is if we access the nextauth jwt, and send the accesstoken stored in header, we are serving this token in js right?

Ответить
@maverick456-33
@maverick456-33 - 08.01.2024 03:28

Google stopped using Cookie. So you should stop using cookie as well lol

Ответить
@anasouardini
@anasouardini - 08.01.2024 03:56

This is like worrying about a thief peeking at your p*n collection when he enters your home SOMEHOW.
I didn't watch the whole video because the fist part throw me off.

Ответить
@twocsies
@twocsies - 08.01.2024 04:25

The server could alternately use CSP to prevent access to injection using nonces.

Ответить
@mintx1720
@mintx1720 - 08.01.2024 04:51

Where should I put them? Inside a div of course. If only I know how to center them.

Ответить
@M.FaisalAmin
@M.FaisalAmin - 08.01.2024 05:21

Always use secret local storage, like react-secure-storage and you are good to go 🎉 🎉

Ответить
@Hypergraph
@Hypergraph - 08.01.2024 05:36

wow Josh you deleted my comment because i said i am leaving react world? what's wrong with what i wrote?

Ответить
@user-sc2dc4ud7b
@user-sc2dc4ud7b - 08.01.2024 06:54

Can you please make a tutorial using Authjs V5, cookie approach, and server actions. Please!!! 😊

Ответить
@mohammedilyas17
@mohammedilyas17 - 08.01.2024 07:10

Josh next time chooses any advance topic

Ответить
@johnxina3536
@johnxina3536 - 08.01.2024 08:03

Now make video on how we can store data in cookies.....

Ответить
@BlurryBit
@BlurryBit - 08.01.2024 09:29

Local storage was not a mistake. It has its uses. Even cookies are not secure if you don't have the correct configuration. People should stop using local storage for what it is not meant for lol.

Ответить
@jaspreetmaan121
@jaspreetmaan121 - 08.01.2024 09:34

if someone can find a way to execute javascript on your app, then you are already screwed, doesn't matter if you token is in cookies or local storage

Ответить
@user-ms5nu1co5q
@user-ms5nu1co5q - 08.01.2024 11:06

Can’t we just encrypt data and secret word will be saved in environment value? This way even if the manage get data it is useless or am I wrong?

Ответить
@maxterminatorx
@maxterminatorx - 08.01.2024 11:42

So we have to use AES encryption layer

Ответить
@andrei_fyi
@andrei_fyi - 08.01.2024 11:48

this is... misinformation

Ответить
@umargulzar2982
@umargulzar2982 - 08.01.2024 12:09

Mr Josh is a Legend instructor...

Ответить
@haithem8906
@haithem8906 - 08.01.2024 12:22

where do you think the user gets his cookies from.
if the xss attacker instead of taking the cookies from the browser,
he will just ask for more cookies from the server in behalf of the user.

... there you go.
once your website is xss attackable.. you are doomed

Ответить
@CookerSingh
@CookerSingh - 08.01.2024 14:20

Now he banned local storage. The channel should be renamed as "Josh is still figuring out Coding"

Ответить
@backupmemories897
@backupmemories897 - 08.01.2024 14:41

i like it.. u dont put any secure data stuff on it anyway xD lol.. this is just blubering nonsense. who thinks that way anyway xD omg

Ответить
@Kats0unam1
@Kats0unam1 - 08.01.2024 14:58

Server side Javascript was a mistake

Ответить
@codeline9387
@codeline9387 - 08.01.2024 15:27

leaves the door open:
- look how houses are insecure

Ответить
@krome305
@krome305 - 08.01.2024 15:52

for viewers: it's ok to use LS :)

Ответить
@philheathslegalteam
@philheathslegalteam - 08.01.2024 16:47

I beg everyone to just think. During XSS the attacker becomes YOU!! It don’t matter if they have your tokens or not, if you’re logged in they ARE YOU. You’re rekt regardless of how secure that auth token is placed.

Invalidating all sessions immediately and fixing the XSS vulnerability is the only solution.

Ответить
@David-gj6dc
@David-gj6dc - 08.01.2024 19:19

The solution to XSS is to sanitize your inputs and outputs, not to never use localStorage. If you're using a popular framework it's probably already sanitizing your outputs for you even. I feel like this video is mixing up a bunch of topics that don't necessarily need to be.. it comes across as a bit unfocused to me

Ответить
@bbfrancis23
@bbfrancis23 - 08.01.2024 21:09

You are using localstorage in the wrong way. Save theme data there, what page the user is on, on a table. Localstorage was not a mistake what makes you think you are smarter than a whole corporation. They thought about long and hard.

Ответить
@NateTron99
@NateTron99 - 09.01.2024 02:54

josh u got me back into coding i use ur stuff day to day and i love how you structure your projects! thank you for all that you do

Ответить
@edd6927
@edd6927 - 09.01.2024 08:19

This is such incomplete and utterly garbage advice

Ответить
@halimnabil4575
@halimnabil4575 - 09.01.2024 10:55

Ummm i would love to inform you that cookies aren't safe anymore

Ответить
@bgdnsr
@bgdnsr - 09.01.2024 11:31

my god dude, learn how the web works. cookies do nothing for you if an attacker is in, he can make requests that pass along the cookie

Ответить
@forever-knight
@forever-knight - 09.01.2024 20:05

Bro i think LS just works on a single domain and seperate for every user so there is really no way for hackers to access someone elses LS and using a cookie as an alternative wont change anything, hackers only have access to their data.

Ответить
@guseynismayylov1945
@guseynismayylov1945 - 10.01.2024 18:14

Jesus Fucking Christ, now I understand why react is popular.

Ответить
@NuncNuncNuncNunc
@NuncNuncNuncNunc - 19.01.2024 20:55

I hung my front door key from teh screen door, now someone has taken all my stuff. Don't use doors.

Ответить
@anaalmeida2327
@anaalmeida2327 - 29.03.2024 21:11

inam disappointed by this video because I was really enjoying the content until now

Ответить
@kellog89
@kellog89 - 15.05.2024 09:51

So what are the alternatives to local storage?

Ответить