Description
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. This attack is typically used in conjunction with some form of social engineering, as the attack is exploiting a code-based vulnerability and a user's trust.
Attack scenario (OWASP)
A possible attack scenario is demonstrated below:
- Attacker discovers injection vulnerability and decides to use an HTML injection attack
- Attacker crafts malicious link, including his injected HTML content, and sends it to a user via email
- The user visits the page due to the page being located within a trusted domain
- The attacker's injected HTML is rendered and presented to the user asking for a username and password
- The user enters a username and password, which are both sent to the attackers server
Remediation
Your script should filter metacharacters from user input.
References
Testing for HTML Injection (OTG-CLIENT-003)
CERT advisory CA-2000-02 Malicious HTML Tags Embedded in Client Web Requests
Related Vulnerabilities
WordPress Plugin Restaurant Menu by MotoPress Cross-Site Scripting (2.4.1)
WordPress Plugin Spreadsheet Cross-Site Scripting (2.0)
WordPress Plugin Job Manager Cross-Site Scripting (0.7.25)
WordPress Plugin PropertyHive Cross-Site Scripting (1.4.14)
WordPress Plugin Events Shortcodes For The Events Calendar Cross-Site Scripting (1.7.1)