HTML Injection
HTML Injection
Injection
What is HTML?
HTML is the language that determines how application data (like
a products catalog) gets presented to users in their web browser.
This language contains visualization commands, like the colour of
the page’s background and the size of embedded pictures. It also
contains links to other web pages, and additional commands
intended for the user’s browser.
On modern interactive websites, the content of a web page often
reflects the processing results of previous user actions.
If user input is not validated and the application is vulnerable, an
attacker could create and send input to the application that allows
a piece of HTML code to be injected into the HTML content in the
application's response.
HTML Injection:
HTML injection is a web vulnerability that lets an attacker inject
malicious HTML content into legitimate HTML code of a web
application.
HTML Injection is an attack that is similar to Cross-site Scripting
(XSS). While in the XSS vulnerability the attacker can inject and
execute Javascript code, the HTML injection attack only allows the
injection of certain HTML tags.
When an application does not properly handle user supplied data,
an attacker can supply valid HTML code, typically via a parameter
value, and inject their own content into the page.
var user_name=location.href.indexOf(“user=”);
document.getElementById(“Thank you for filling our
questionnaire”).innerHTML=” Thank you for filling our
questionnaire, ”+user;
References
i. https://www.researchgate.net/figure/Real-HTML-injection-
example_fig1_39556078
ii. https://www.imperva.com/learn/application-security/html-
injection/
iii. https://www.acunetix.com/vulnerabilities/web/html-
injection/
iv. https://www.wallarm.com/what/html-injection