Are You Doing Enough To Protect Your Website?

Sachin Mamoru
JavaScript in Plain English
4 min readFeb 6, 2021

--

Photo by Thom Milkovic on Unsplash

As developers or clients, our main enigma is the protection of our web site. So to fulfil that, most of us are using backends and use authentication mechanisms, encryptions, tokens, access controls, etc. But do we provide proper attention to the web site's frontend security?

No, right? So at first let’s talk about some possible frontend attacks.

Cross-Site Scripting (XSS) Attack — Normally what the browser does is, it will run the bundle of scripts that are loaded as the web application. So in these types of attacks, hackers will input a malicious script into that web application script bundle. Then without knowing the cause browser will execute it.

Cross-Site Request Forgery (CSRF) — This attack is kind of tricky since it will disguise the victim. Normally when a user authenticated to a website, all the requests made up to that website, will have credentials associated with that user account. Such as session cookie, IP address, etc. So if somehow (using a fake email to the victim) the attacker sends this request to the site backend, then the server will not be able to differentiate the request. So then the attacker will try to change the state of the account such as changing the email or password.

DOS (Denial Of Service) Attack — This attack is simply implemented by making many requests to the server in a very small amount of time (milliseconds). That will make the server lack resources to balance the traffic and eventually the server will be unavailable to the users. But do you think, that this will be simply prevented by blocking the origin IP with so many requests? Yes, that’s a possible solution.

But what if it was made from multiple sources. Then it’s not that simple as you see. These are called DDOS (distributed denial-of-service attack) attacks.

Now we can find some tools to stop these frontend attacks and mitigate the risk of website security.

jscrambler

I personally recommend this since I have used this tool for my own work, and it simply does the work. This tool is helpful in two ways, which are javascript security and web security. Javascript security in a sense, JavaScript obfuscation techniques combined with polymorphic behavior, code locks, self-defending capabilities, and threat monitoring. Web security provides real-time client-side monitoring on frontend attacks.

Code Integrity

  • JavaScript Protection
  • Hybrid/Native Code Protection
  • JavaScript Threat Monitoring

Webpage Integrity

  • Magecart Mitigation
  • Data Exfiltration
  • Webpage Monitoring
source — Jscrambler YouTube Channel

For more details refer to this.

JSDefender

This is a professional grade obfuscation and web app protection system offered by PreEmptive company, which is an industry leader in smart application protection. The solution will hide your business logic and make it impossible for the hackers to reverse engineer the code. Not only that it will reduce the code size using minification techniques.

source — PreEmptive YouTube Channel

For more details refer to this.

sqreen

source — https://www.sqreen.com/platform

This is a modern enterprise application protection system with a real-time monitoring system. It has three major components.

  1. Sqreen Microagent — This is a library inside the app, that acts as a monitoring system for all the requests and their meta information. Then it will communicate the analyzed data to the sqreen platform in the cloud.
  2. Security Engine — This is the security layer of the web application.
  3. Sqreen Platform — This is the cloud platform that communicates with the other two components and analyzes the data to detect anomalies.

For more details refer to this.

Not only these tools, but there are also many other tools in the industry that can be used for web application protection. But these are tools that used in the industry for a longer time. So these are very reliable tools.

But if you think, your web application is not much scaled up and if it’s a small application, therefore going for these types of tools is not necessary at this level. At least you should try to focus on the following aspects when you building your applications.

  • Focus on security while you were developing the application. Don’t wait until the last moment. It will make you do major architectural changes to improve security.
  • Try to use modern frameworks (Angular, React, Vue, etc.) to create applications, hence they have in-built web protection tools.
  • Try to avoid typical XSS mistakes.
  • Use textContent instead of innerHTML, because textContent can only output text and doesn’t generate any HTML.
  • Be cautious when using third party dependencies.

These are few tips for your reference, use them well and protect your web application.

Resources

--

--