Site icon NodeXperts

What is HTML Injection?

It is a kind of attack in which HTML code is injected through the vulnerable parts of the website with the purpose to change the design or information, that is displayed to the user. As a result, the user may see the data or information that was sent by the malicious user. In simple terms, it can be used to deface a web page or redirect the user to a malicious website.

This injection attack can be performed with two different purposes:

Two main types of HTML injection attack:

Proof of Concept:

There was a contact us/registration page on the application, after submitting the details an email was sent to the user/application owner. HTML injection in E-mail was found while analyzing the application behavior.

Following are the steps:

  1. Open the contact us Page of the application, enter your email id and name. In the Name parameter/comment, Inject HTML Injection payload.

<a href=”uat-v4nodexpert.successive.work”><h1>Please click here to get Rs1000 cashback directly to your account<h1></a>               

  1. A new email is sent to the user/application owner, where the payload is successfully executed.

Impact of HTML Injection

Some possible attack scenario is demonstrated below:

Mitigation of HTML Injection

The attack occurs due to the developer’s negligence and lack of knowledge. Also, this type of attack occurs due to the non-validation of the input and output, therefore it is important to have data validation in place to prevent such attacks.

Exit mobile version