---
title: "Comment by SHOBHIT RASTOGI on \"Introducing StaticShield🛡: Password protect a website in less than 2 mins.\" | Hashnode"
description: "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"
url: "https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517"
---

[Discussion](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c)

Comment [Introducing StaticShield🛡: Password protect a website in less than 2 mins.](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c)

[SHOBHIT RASTOGI](https://hashnode.com/@rs909)

[Jul 1, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517)

[Lalit](https://hashnode.com/@lalit2005) 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](https://staticshield.vercel.app/script.js) 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.

[Lalit](https://hashnode.com/@lalit2005)

[Jul 1, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60dd8d0d0970dd75de76f7f8)

Thanks [SHOBHIT RASTOGI](https://hashnode.com/@rs909), 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](https://staticshield.vercel.app/errors/noscript) 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](https://nextjs.org/docs/basic-features/script)

Please do let me know your queries 🙂

[SHOBHIT RASTOGI](https://hashnode.com/@rs909)

[Jul 1, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60dd92c995305075b933964f)

[Lalit](https://hashnode.com/@lalit2005) Request is blocked not in real time, Please check this you might understand what I am trying to say,

[streamable.com/sxjm3r](https://streamable.com/sxjm3r)

Thanks,

[Lalit](https://hashnode.com/@lalit2005)

[Jul 1, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60ddac4ce51e523e9b7e411d)

Thanks for the response [SHOBHIT RASTOGI](https://hashnode.com/@rs909)

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

Thanks

[SHOBHIT RASTOGI](https://hashnode.com/@rs909)

[Jul 1, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60ddafb583e0d73ecb5b7ca9)

[Lalit](https://hashnode.com/@lalit2005) Clicking on it should work have uploaded on google drive too

[Link](https://drive.google.com/file/d/1chCiSHkog3-YWlzHVNb4mrLMVuQ20Bcx/view)

Please check

[Lalit](https://hashnode.com/@lalit2005)

[Jul 1, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60dde8c183e0d73ecb5b8377)

[SHOBHIT RASTOGI](https://hashnode.com/@rs909) 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 👇

[loom.com/share/ffad11caf8cf4b11b344d1c1844cb7dd](https://www.loom.com/share/ffad11caf8cf4b11b344d1c1844cb7dd)

[SHOBHIT RASTOGI](https://hashnode.com/@rs909)

[Jul 2, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60de9e232c9e6e1780476b1f)

[Lalit](https://hashnode.com/@lalit2005) I am afraid that any client side fix will not work, It can still be manipulated.

1.  Install [extension](https://chrome.google.com/webstore/detail/netify/mdafhjaillpdogjdigdkmnoddeoegblj) in chrome.
2.  Inject the script with the settings shown in the video.

[loom.com/share/dd954763e90343a998c6594697abf85e](https://www.loom.com/share/dd954763e90343a998c6594697abf85e)

Still secured page can be accessed.

[Amal Shaji](https://hashnode.com/@amal)

[Jul 2, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60dea2232c9e6e1780476b94)

[SHOBHIT RASTOGI](https://hashnode.com/@rs909) 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](https://github.com/Lalit2005/staticshield/blob/c4b48243e12e57f9f23b34bb4695e91bfb43b393/pages/api/login-to-site.ts#L98), the **TOKEN\_SECRET** is manually added to the token.

[loom.com/share/2310a29733d44bd2ba86241b8393924f](https://www.loom.com/share/2310a29733d44bd2ba86241b8393924f)

**Now I can mint my own tokens**

[SHOBHIT RASTOGI](https://hashnode.com/@rs909)

[Jul 2, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60deb5a64f8e376422a74bd1)

[Amal Shaji](https://hashnode.com/@amal) That is an excellent observation.

[Lalit](https://hashnode.com/@lalit2005)

[Jul 3, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60e0276e03707d644a4ffedc)

[Amal Shaji](https://hashnode.com/@amal) I do not know why jwt.io shows the signature is verified, but the [jwt token is signed with a different key (`JWT_TOKEN`)](https://github.com/Lalit2005/staticshield/blob/c4b48243e12e57f9f23b34bb4695e91bfb43b393/pages/api/login-to-site.ts#L95) and the `.` is replaced with an other key (`TOKEN_SECRET`)

[Amal Shaji](https://hashnode.com/@amal)

[Jul 3, 2021](https://hashnode.com/posts/staticshield/60dc16d37c7df7644acde86c/comment/60dd885695305075b9339517#reply-60e0291f4f8e376422a76f7c)

[Lalit](https://hashnode.com/@lalit2005) 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.
