In this article, we will talk about security testing using the example of such system vulnerability as XSS injections.
Main Concepts
Security testing is a process of checking the way how well particular software is protected against hacker attacks.
This testing aims to find all the possible vulnerabilities in the software. It verifies the level of information and system security based on intended malicious attacks.
Security testing allows quickly checking how the protection mechanism is built in a system and how the software will behave after this intrusion.
But unfortunately, even if all the possible tests are performed, a QA specialist cannot be sure that developed product is fully protected against hacker attack. The only he/she can assure is that the number of unsanctioned attacks, information theft, and loss of valuable information will be significantly reduced.
XSS
XSS is the most common type of attack on a particular web system. Nowadays, it is the most widespread type of system vulnerability.
During this attack, people implement malicious code (the so-called script that will interact with the hacker’s webserver) on a particular page of a web product. When the user goes to such a page, the attack code is executed.
A lot of us have already seen such vulnerabilities on different sites. It can be pop-up windows with particular information. These pop-ups appear when you visit some website and they have no connection with the topic of this resource. In other words, this is an advertisement that significantly harms the website’s reputation.
XSS attacks can appear in those applications that cannot check and convert information before adding it to their pages. Moreover, the page can be updated through browser API based on information provided by a user and containing HTML and JavaScript code.
Using XSS one can easily conduct different scenarios inside web-browser to intercept user sessions. It is possible to change the web page, or redirect users to some malicious website. The programmer can provide the user with an unnecessary opportunity to add malicious data to the page. Hence, web pages become more vulnerable to potential attacks.
Types of XSS Attacks
Irregular or Reflected
This is the most popular type of hacker attacks on websites. A similar attack is carried out by adding a script to the site’s URL. Since the information is passed without verification, the script (scenario) will constantly be shown to users.
How does it work?
[highlight dark=”no”]The site has a text box with information asking you to check the current status of your bank account with an incomprehensible URL to follow.[/highlight]
A hacker was able to determine that there was a specific vulnerability on a particular site. Such a metric could display a text message after adding some script to the site’s URL that causes the vulnerability. Right after that, it sends an inexperienced user a link through the mailing list or a certain messenger.
The harm is that a specific URL GET parameter cannot be filtered either during script submission or before being applied to the output data point. This is the most popular vulnerability, based on which many attacks known nowadays are performed.
Regular or Persistent
This type of attack is very serious by its structure. It means that hacker doesn’t only adds a script to URL manually but also saves a code on a server.
In this situation, the program code will be executed in the browser whenever the user goes to the web page. The most common example is forums, as people can easily post a lot of comments in simple HTML format there.
How does this happen?
[highlight dark=”no”]A site has a link to an online lottery where the winners are already known, and you are asked to try your luck with the main prize.[/highlight]
The hacker realized that there was a vulnerability on a certain site that could display the necessary message constantly when users go to the chat page. This vulnerability will be working until the site administrator notices it.
By the way, all XSS vulnerabilities can arise when incorrect filtering is performed, when input information is saved to a database on a specific server, or when data is written to specific files. After, this data is shown to the user to deceive him.
Conclusion
To sum up all the above, we can confidently say that XSS is one of the most common types of modern vulnerability in web products. They help a hacker inject his dangerous scripts into pages that Internet users will view in the future.
To maximize the security of your web resources, you need to follow the basic principles of protecting the resource. You should assess the system for the presence of shortcomings at the current moment in its system security from the position of an ordinary hacker.
0 Comments