One more auth system that will give you nightmares...
This JavaScript code powers a 1,500 user intranet application.
The longer you look at it the more insane it gets.
One more auth system that will give you nightmares...
This JavaScript code powers a 1,500 user intranet application.
The longer you look at it the more insane it gets.
@LoganDice The icing on the cake is the todo comment on top.
Like putting it in a different file is the LEAST of your concerns here. 🤣
@LoganDice if ("true" === "true") { return false; }
*chef kiss*
Not to mention that it's a frontend code, so anyone can see all the user's info. And execute arbitrary sql, if you want to drop all tables for example.
That is going to give me nightmares.
@LoganDice A reply from a friend of mine who read this toot:
"Don't think of it as a security vulnerability, think of it as backing up your user database on every client" 🤣
@LoganDice raw sql exposed, severe language weirdness, unhashed passwords of all users sent to anyone on every login attempt and then "logged in" is just a cookie you can set arbitrarily anyways and there's *still* more…
Truly astounding – it's like a masterpiece of horrible software engineering.
@LoganDice You. Are. Kidding. Me.
So many layers of SHIT NO!!!
I'm kinda curious about that "True" === "True" at the bottom. Is that an established JavaScript idiom with a well known purpose? Or is it just there?
@LoganDice this is wrong on so many levels!
- passwords are not encrypted.
- open to sql injection (there still can be mean people on intranet)
- you are fetching the entire datatable!
My eyes are bleeding at the moment. And that’s not because of the monokai theme :)