Sign in
Log inSign up
Lalit

327 likes

Β·

3.6K reads

43 comments

Savio Martin
Savio Martin
Jun 30, 2021

This is amazing Lalit. Excellent work done. The feature to protect a page in (<2 mins) is wonderful. Great Idea and implementation. πŸ‘ I'm surely gonna use this, saves a lot of time. Loved the look and simplicity. Well done πŸ‘ Great Job.

Keep up the amazing work Lalit, Keep rocking πŸ₯³

8
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jun 30, 2021

Thanks a lot Savio!

This means a lot. Glad you liked my project.

By the way, your project - CodeHouse is also super awesome πŸ”₯

Β·
Gaurav Tewari
Gaurav Tewari
Jul 3, 2021

This is next-level work. a password-protected site just in two min. Awesome !!

8
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jul 3, 2021

Thanks a lot Gaurav Tewari

Glad you liked it πŸ™‚

3
Β·
Amal Shaji
Amal Shaji
Jun 30, 2021

Regarding the security,

const bcryptHashedPassword = bcrypt.hashSync(reversedSHAHash, 5);

Here 5 is the salt round or cost factor. The total number of rounds/times hashed = 2 ^ (salt rounds). So your implementation hashes the password 32 times. Nowadays, bcrypt libraries use the cost factor of 10 by default, i.e., 1024 rounds.

4
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jun 30, 2021

Oh I did not know about that at all!

Thanks a lot Amal Shaji

Β·
Aditya Mitra
Aditya Mitra
Jul 7, 2021

This is one product that I had been looking for. I always wanted to created something like this but never got the time.

Congratulations!

4
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jul 7, 2021

Thanks Aditya Mitra

Hope you liked it πŸ™‚

1
Β·
Patrick
Patrick
Jun 30, 2021

Great thing. Good luck @lalit2005.

3
Β·
Β·3 replies
Lalit
Lalit
Author
Β·Jun 30, 2021

Thanks Patrick

Hope you liked StaticShield πŸ™‚

Β·
Patrick
Patrick
Jun 30, 2021

Lalit Yes, it is great maybe I will use it in my next project. 😊

Β·
Lalit
Lalit
Author
Β·Jul 1, 2021

Patrick

Wow, glad to hear that. I'm waiting for you to use StaticShield πŸ™‚

Β·
Shyam Ganesh
Shyam Ganesh
Jun 30, 2021

This is amazing Lalit I have used this and it is awesome.

2
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jun 30, 2021

Thanks Shyam Ganesh

Hope you liked it :)

Β·
Prince Codes
Prince Codes
Jun 30, 2021

Awesome

2
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jul 1, 2021

Thanks Prince Codes

Hope you liked it

Β·
Yafet Shah
Yafet Shah
Jul 1, 2021

Wow! This saved my day!

Loved it

Going to use it to protect our small company's MRR details and analysis. Very handy indeed.

Thanks for the project Lalit!!

2
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jul 1, 2021

Happy to see StaticShield in wild!

Thanks Yafet Shah

Β·
Rutik Wankhade
Rutik Wankhade
Jul 2, 2021

This is awesome man!! πŸš€πŸš€ The UI sure does give the vercel vibe. Great job with the implementation. πŸ‘πŸ‘

2
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jul 2, 2021

This means a lot. Thanks you so much Rutik Wankhade

Β·
Andrew Baisden
Andrew Baisden
Jul 7, 2021

Now this is a really good product idea good job Lalit πŸ‘

2
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jul 7, 2021

Thank you so much Andrew Baisden

Β·
Piotr BadeΕ‚ek
Piotr BadeΕ‚ek
Jul 5, 2021

The idea is really nice, but since this is client-side, it can easily be avoided: https://disk.yandex.com/i/u_yuF6BhxMVF2Q
I can just block the entire staticshield.vercel.app domain and add some custom CSS to bypass staticshield.
This is not a very secure solution. Also, the page that informs you that you need to enable javascript ( https://staticshield.vercel.app/errors/noscript )... does not work without javascript

1
Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jul 5, 2021

Hello Piotr BadeΕ‚ek, I am aware that you can bypass now. I am fixing all these issues currently with a greater security in place. This will be out soon. For now, you can use it with apps that has non-developer users.

staticshield.vercel.app/errors/noscript )... does not work without javascript

Yeah, I've noticed it. I'm finding solution to avoid this. I'll be fixing this soon

Β·
Jake David
Jake David
Jun 30, 2021

This is really really awesome. Good luck Lalit

Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jun 30, 2021

Thanks Jake David πŸ™‚

Β·
SHOBHIT RASTOGI
SHOBHIT RASTOGI
Jul 1, 2021

Lalit Your site and work looks amazing. Keep up the great work. But does it really works ? scripting based security can be manipulated in browser, One can block the script in browser and can access the secured page even without password.

  1. Block the script in browser.
  2. Unhide staticshield-div

And there you go you can see the secured page, no matter how many times it is hashed :p

Maybe this can be used as a quick solution but not certainly to make anything secured,

Please let me know if I am missing anything.

Β·
Β·10 replies
Lalit
Lalit
Author
Β·Jul 1, 2021

Thanks SHOBHIT RASTOGI, glad you liked StaticShield

– One can block the script in browser and can access the secured page even without password.

I have taken that into account - If javascript is blocked from executing, the <noscript> tag instantly gets activated which then redirects the page here which asks the user to enable Javascript (and links them to a guide). Moreover Javascript frameworks like react and vue require js to render and paint the screen itself.

– Unhide staticshield-div

When a password protected site loads, the rendered HTML is not displayed with the help of CSS. And as soon as the javascript script loads, the user is redirected to login page if no valid token exists.

Removing the staticshield-div is practically not possible because the rendering of html and css happens in milliseconds usually, and opening the DevTools and removing the staticshield-div class in this short period of time is practically impossible.

Frameworks like Next.js (version 11) prioritize the execution of client js scripts before the rendering of html and css when the stratergy is set to beforeInteractive. More info here

Please do let me know your queries πŸ™‚

Β·
SHOBHIT RASTOGI
SHOBHIT RASTOGI
Jul 1, 2021

Lalit Request is blocked not in real time, Please check this you might understand what I am trying to say,

streamable.com/sxjm3r

Thanks,

Β·
Lalit
Lalit
Author
Β·Jul 1, 2021

Thanks for the response SHOBHIT RASTOGI

The link seems to be broken, can you please check it?

Thanks

Β·
SHOBHIT RASTOGI
SHOBHIT RASTOGI
Jul 1, 2021

Lalit Clicking on it should work have uploaded on google drive too

Link

Please check

Β·
Lalit
Lalit
Author
Β·Jul 1, 2021

SHOBHIT RASTOGI That was a good catch! I did not know that you can block certain requests with Chrome DevTools.

I just pushed a solution for it!! I have updated only the with-html example. I will be updating others soon.

Here's a demo πŸ‘‡

Β·
SHOBHIT RASTOGI
SHOBHIT RASTOGI
Jul 2, 2021

Lalit I am afraid that any client side fix will not work, It can still be manipulated.

  1. Install extension in chrome.
  2. Inject the script with the settings shown in the video.

Still secured page can be accessed.

2
Β·
Amal Shaji
Amal Shaji
Jul 2, 2021

SHOBHIT RASTOGI This is an excellent catch. I didn't think of it this way. Another concern is the way security is handled in the backend. In this block of code, the TOKEN_SECRET is manually added to the token.

Now I can mint my own tokens

2
Β·
SHOBHIT RASTOGI
SHOBHIT RASTOGI
Jul 2, 2021

Amal Shaji That is an excellent observation.

Β·
Lalit
Lalit
Author
Β·Jul 3, 2021

Amal Shaji I do not know why jwt.io shows the signature is verified, but the jwt token is signed with a different key (JWT_TOKEN) and the . is replaced with an other key (TOKEN_SECRET)

Β·
Amal Shaji
Amal Shaji
Jul 3, 2021

Lalit The only way the signature gets verified is only when the tokens are the same. I did not introduce any external factors, all the variables are derived from the token presented to me after a login.

Β·
itkj
itkj
Jul 1, 2021

Thank u for new knowledge for me.

Β·
Candy
Candy
Jul 2, 2021

Liked your project idea a lot!!!

Β·
Β·1 reply
Lalit
Lalit
Author
Β·Jul 2, 2021

Glad you liked my project Candy Tsai πŸ™‚

1
Β·
Milo πŸ³οΈβ€πŸŒˆ πŸ¦‹ Xeon
Milo πŸ³οΈβ€πŸŒˆ πŸ¦‹ Xeon

This is simply amazing. Authorization is a notoriously common thing to do wrong. To just automate it, what a brilliant idea!

What about privacy, though?

Β·
Β·3 replies
Lalit
Lalit
Author
Β·Jul 4, 2021

Thanks for the kind words Miloslav πŸ³οΈβ€πŸŒˆ πŸ¦‹ Voloskov

What about privacy, though?

Do you mean users' privacy? If yes, every user data is handled by Auth0, which is trusted by many companies. StaticShield accesses only email, name, nickname, profile picture and user-id of users.

Please do let me know your queries πŸ™‚

1
Β·
Milo πŸ³οΈβ€πŸŒˆ πŸ¦‹ Xeon
Milo πŸ³οΈβ€πŸŒˆ πŸ¦‹ Xeon

Lalit auth0? Nice! I’ll definitely give it a try then πŸ‘

3
Β·
Lalit
Lalit
Author
Β·Jul 4, 2021
Β·