Methods to Exploit HTML Injection

Cristian Cornea
3 min readMay 18, 2022

In this article, we will discuss the HTML Injection vulnerability, and 3 methods of how to creatively leverage it for exploitation.

Firstly, let’s have an overview of HTML Injection.

What is HTML Injection?

Before starting to go into details, I want to clarify that HTML Injection is not Cross-Site Scripting (XSS). Those two are totally different vulnerabilities.

In an XSS attack, you are able to inject JavaScript into the vulnerable application. On the other side, in an HTML Injection attack, you will be able to execute only HyperText Markup Language (HTML), including CSS sometimes.

Both XSS and HTML Injection have the same root cause — unvalidated input accepted.

Usually, if the input is reflected or stored within the application without any further validation or escaping, then it can be a scenario where you will have an HTML Injection. If the JavaScript is blocked due to any protection mechanisms, such as Content Security Policy (CSP), then you may try inserting only HTML code.

#1: Open Redirection through HTML Injection

In this scenario, you can achieve two things from one shot:

  1. External Redirection to a phishing page or some attacker’s controlled domain
  2. Application Denial-of-Service (DoS) on the page where you insert the payload and get executed, because the users will not be…

--

--

Cristian Cornea
Cristian Cornea

Written by Cristian Cornea

🥷🏻Zerotak - Cyber Security & Pentesting 🧑‍🎓CSTCE - Cyber Security Training Centre of Excellence 🦉SectionX.io - Threat Intel🧛🏼BSides Transylvania

Responses (3)